我从net-snmp软件包在linux上使用snmptrapd。 我试图让一些perl脚本来处理snmp陷阱。 我已经有了这样的脚本,它可以与snmp v1,v2c陷阱和snmpv3陷阱一起使用,但只有当我在config和in命令发送陷阱中明确指定了engineID时。 但是,当我configuration思科路由器发送给我linkDown陷阱它使用一些额外的字节MAC地址作为引擎ID。 我可以看到trapha在wireshark的界面上,但是snmptrapd什么都不做。 是否可以configurationsnmptrapd接受所有authentication用户的陷阱,而无需指定engineID?
这是我的snmptrapd.conf
# Example configuration file for snmptrapd # # No traps are handled by default, you must edit this file! # createUser -e 0x0102030405 myuser MD5 mypassword DES myotherpassword createUser -e 0x0102030405 myuser2 MD5 mypassword DES myotherpassword createUser -e 0x0102030406 myuser2 MD5 mypassword DES myotherpassword createUser cisco SHA cisco123 DES cisco123 authUser log,execute myuser authUser log,execute myuser2 authUser log,execute cisco authCommunity log,execute public perl do "/usr/local/share/snmp/snmptrapdhandler.pl";
我正在使用Fedora 21 Linux,
$ uname -a Linux 4.1.13-100.fc21.x86_64 #1 SMP Tue Nov 10 13:13:20 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
而net-snmp版本是net-snmp-5.7.2-23.fc21.x86_64
我们收到陷阱时没有从snmpv3的cisco设备中指定引擎ID。 但是我们在cisco设备上使用MD5 / DES。
Linux 02asdf 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux ii snmp 5.7.3+dfsg-1ubuntu4 amd64 SNMP (Simple Network Management Protocol) applications ii snmp-mibs-downloader 1.1 all Install and manage Management Information Base (MIB) files ii snmpd 5.7.3+dfsg-1ubuntu4 amd64 SNMP (Simple Network Management Protocol) agents ii snmpsim 0.2.4-1 all SNMP agent simulator ii snmptrapd 5.7.3+dfsg-1ubuntu4 amd64 Net-SNMP notification receiver ii snmptt 1.4-1 all SNMP trap handler for use with snmptrapd