snmp v3 trap(send and receive use net-snmp)

发布时间:2016-12-9 23:31:29 编辑 分享查询网我要评论
本篇文章主要介绍了"snmp v3 trap(send and receive use net-snmp)",主要涉及到snmp v3 trap(send and receive use net-snmp)方面的内容,对于snmp v3 trap(send and receive use net-snmp)感兴趣的同学可以参考一下。

1. install net-snmp-5.7.2 2. send and receive snmp v3 trap From A SNMPv3 TRAP (for this, I'm making up an engineID to use: 0x8000000001020304) In a /tmp/snmptrapd.conf file put: createUser -e 0x8000000001020304 traptest SHA mypassword AES authuser log traptest Then start snmptrapd pointing to that file (runs in the foreground, uses only that config file and logs to stderr): (1)snmptrapd -f -C -c /tmp/snmptrapd.conf -Le  or(2)snmptrapd -f -C -c /usr/local/net-snmp/share/snmp/snmptrapd.conf -Le -m /usr/local/net-snmp/share/snmp/mibs/xx.mib  or (3)snmptrapd -f -C -c /usr/local/net-snmp/share/snmp/snmptrapd.conf -Lf /usr/log -m /usr/local/net-snmp/share/snmp/mibs/xx.mib-m 指定mib库-f do not fork from the shell-C do not read the default configuration files-L <LOGOPTS> toggle options controlling where to log to            e:           log to standard error            o:           log to standard output            n:           don't log at all            f file:      log to the specified file            s facility:  log to syslog (via the specified facility) Then run snmptrap (in another window) to send a linkup trap: snmptrap -v 3 -n "" -a SHA -A mypassword -x AES -X mypassword -l authPriv -u traptest -e 0x8000000001020304 localhost 0 linkUp.0  -e ENGINE-ID        set security engine ID (e.g. 800000020109840301) You should see this in the output of the window running snmptrapd: 2007-10-10 10:19:11 localhost [UDP: []:46380]: DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::snmpTrapOID.0 = OID: IF-MIB::linkUp.0 3. snmptrapd may be failed error: couldn't open udp:162 -- errno 98 ("Address already in use") fix:ps -ef | grep snmptrapd to kill snmptrapd