net-snmp send spoof-trap

NuDesign Visual MIBrowser Pro to view mids.

注意参数需要加.index

1)snmptrap -v2c -c public 127.0.0.1 "" trap_oid varible.index varible_type varible_value
2)snmptrap -v2c -c public 127.0.0.1 "" IF-MIB::linkDown ifAdminStatus.22 i 2
3)snmptrap -v2c -c public 127.0.0.1 "" 1.3.6.1.6.3.1.1.5.3 1.3.6.1.6.3.1.1.5.3.22 i 2

监听trap::snmptrapd -f -Lo

net-snmp mib文件存放地点
/usr/share/snmp/mibs

配置文件存放地点
/etc/snmp/snmpd.conf

/etc/init.d/snmpd restart
---------------------------------------------------
•Conf file locates at:  /etc/snmp/snmpd.conf

•Mibs file locates at:  /usr/share/snmp/mibs

•Restart it by command

•: /etc/init.d/snmpd restart

•snmpget -v2c -c public 127.0.0.1 sysName.0

•snmpgetnext -v2c -c public 127.0.0.1 sysName.0

•snmpwalk -v2c -c public ip 1.3.6.1.2.1.2.2.1.1

•snmptable -v2c -c public ip 1.3.6.1.2.1.2.2

trap listener in port 162(default)

•snmptrapd -f -Lo

send traps

•snmptrap -v2c -c public 127.0.0.1 '' IF-MIB::linkDown ifAdminStatus.2 i 2

•snmptrap -v2c -c public 127.0.0.1 "" 1.3.6.1.6.3.1.1.5.3 1.3.6.1.6.3.1.1.5.3.22 i 2

Previously, snmptrapd would accept all incoming notifications, and log them auto...
Previously, snmptrapd would accept all incoming notifications, and log them automatically (even if no explicit configuration was provided). Starting with release 5.3, access control checks will be applied to incoming notifications. If snmptrapd is run without a suitable configuration file (or equivalent access control settings), then such traps WILL NOT be processed. See the section ACCESS CONTROL for more details.
The option you are probably interested in can be found at the bootom of the "ACCESS CONTROL" section. It says:
disableAuthorization yes
will disable the above access control checks, and revert to the previous behaviour of accepting all incoming notifications.

If you add
disableAuthorization yes
to /etc/snmp/snmptrapd.conf you should be happy. If this file does not exist, create it, then restart snmptrapd. It does appear that snmptrapd.conf may alternately be found in /usr/share/snmp, but I have not put it there in any of my configurations.

你可能感兴趣的:(C++,c,.net,C#,F#)