最近在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>' –