天天看點

A SNMPv3 TRAP

url:http://www.net-snmp.org/wiki/index.php/TUT:Configuring_snmptrapd_to_receive_SNMPv3_notifications

(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):

snmptrapd -f -C -c /tmp/snmptrapd.conf -Le
      

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
      

You should see this in the output of the window running snmptrapd:

2007-10-10 10:19:11 localhost [UDP: [127.0.0.1]:46380]: DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (0) 0:00:00.00 SNMPv2-MIB::snmpTrapOID.0 = OID: IF-MIB::linkUp.0
      

Success!

繼續閱讀