最近在Net-SNMP邮件列表上询问就像赢得彩票一样,即从未发生。使用Net-SNMP的snmpset的多个值
我需要知道如何使用snmpset为我的命令标量设置多个参数值?
我已经实现了我的命令作为简单的标量,但最近我想也许我需要将它们实现为表,因为它们可以有多个参数。
当使用snmpset设置/触发这样一个命令时,选择是没有参数,一个参数或多个参数。
给出以下用于表的MIB示例。让我们说这是我的命令之一。 显然,SMIv2中不再允许写入,因此我使用了不可访问的。这些命令不能被snmpget访问。
netSnmpHostsTable OBJECT-TYPE
SYNTAX SEQUENCE OF NetSnmpHostsEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"An example table that implements a wrapper around the
/etc/hosts file on a machine using the iterator helper API."
::= { netSnmpExampleTables 2 }
netSnmpHostsEntry OBJECT-TYPE
SYNTAX NetSnmpHostsEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"A host name mapped to an ip address"
INDEX { netSnmpHostName }
::= { netSnmpHostsTable 1 }
NetSnmpHostsEntry ::= SEQUENCE {
netSnmpHostName OCTET STRING,
netSnmpHostAddressType OCTET STRING,
netSnmpHostAddress OCTET STRING
}
netSnmpHostName OBJECT-TYPE
SYNTAX OCTET STRING (SIZE(0..64))
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"A host name that exists in the /etc/hosts (unix) file."
::= { netSnmpHostsEntry 1 }
netSnmpHostAddressType OBJECT-TYPE
SYNTAX OCTET STRING (SIZE(0..64))
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"The address type of then given host."
::= { netSnmpHostsEntry 2 }
netSnmpHostAddress OBJECT-TYPE
SYNTAX OCTET STRING (SIZE(0..64))
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"The address of then given host."
::= { netSnmpHostsEntry 3 }
不带参数调用
snmpset netSnmpHostsTable.0
或3个参数调用
snmpset netSnmpHostsTable.1东西netSnmpHostsTable.2别的netSnmpHostsTable.3更多的东西
snmpset可能吗?当用snmpset设置多行时,它会将它作为一个请求还是多个请求处理?
我可以给你的email地址:'[email protected], 尼尔斯安徒生所喜爱的<[email protected] .NET>' –