这取决于陷阱中是否引用了“标量”或“表行”相关的varbinds.
Note that this command also includes an (OID,type,value) triple for
the varbinds listed in the VARIABLES clause (in the same way as with
the snmpset command).
表行示例.
snmptrap -v 2c -c public host:162 .1.3.6.1.6.3.1.1.5.3 .1.3.6.1.6.3.1.1.5.3 \
ifIndex i 2 ifAdminStatus i 1 ifOperStatus i 1
以供参考 :
snmptranslate -m +ALL -Pu .1.3.6.1.6.3.1.1.5.3
IF-MIB::linkDown
变量绑定中没有“.0”,因为id由第一个精确定位行的ifIndex处理.
标量行示例.
snmptrap -v 1 -c public host UCD-TRAP-TEST-MIB::demotraps "" 6 17 "" \
SNMPv2-MIB::sysLocation.0 s "Just here"
‘SNMPv2-MIB :: sysLocation.0’是一个标量.
与上面的IF-MIB :: linkDown示例不同,它与ifIndex所标识的表行有关,这里最后的“.0”指向标量(就像你设置它时一样)
来自原始问题的Netsnmp示例
mibs / NET-SNMP-EXAMPLES-MIB.txt状态
netSnmpExampleHeartbeatRate OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS accessible-for-notify
STATUS current
DESCRIPTION
"A simple integer object, to act as a payload for the
netSnmpExampleHeartbeatNotification. The value has
no real meaning, but is nominally the interval (in
seconds) between successive heartbeat notifications."
::= { netSnmpExampleNotificationObjects 1 }
即它不是真正可识别或可访问的标量,因此不使用“.0”.