php net-snmp trap,什么是正确的snmptrap命令格式?

这取决于陷阱中是否引用了“标量”或“表行”相关的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”.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值