最近询问Net邮件列表就像中奖一样,也就是说,它从未发生过。
我需要知道如何使用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 netSnmpHostTable.1一些netSnmpHostTable.2一些其他netSnmpHostsTable3更多的
用snmpset有可能吗?当使用snmpset设置多个行时,它是将其处理为一个请求还是多个请求?
发布于 2013-08-08 15:35:14
不可访问恰恰意味着,您将无法设置、获取或甚至在步行中看到这些信息,因为它们是不可访问的,即它们只是定义结构的节点。
您可能需要使用读-写,或读-创建,如果您的表将有一个条目状态来添加行,我不知道为什么只写了,这是有意义的一些事情。
在回答“是”的问题时,命令如下:
C:\net-snmp\bin\snmpset -v 2c -c public -M +C:\mibs -m SOME-MIB 10.20.30.40 SOME-MIB::someString.9 = "martski" SOME-MIB::someOtherString.9 = "http://waratah.webs.com/" SOME-MIB::someEntryStatus.9 = createAndGohttps://stackoverflow.com/questions/13563235
复制相似问题