SNMP Test Trap verschicken

Posted: 2nd April 2012 by Thorben Hemmler in SNMP
Tags: ,

Eine Datei mit folgendem Inhalt anlegen

/usr/share/snmp/mibs/TRAP-TEST-MIB.txt

TRAP-TEST-MIB DEFINITIONS ::= BEGIN
IMPORTS ucdExperimental FROM UCD-SNMP-MIB;

demotraps OBJECT IDENTIFIER ::= { ucdExperimental 990 }

demo-trap TRAP-TYPE
STATUS current
ENTERPRISE demotraps
VARIABLES { sysLocation }
DESCRIPTION "This is just a demo"
::= 17

END

MIB exportieren:

export MIBS=+TRAP-TEST-MIB

Senden des Test-Traps

snmptrap -v 1 -c public 192.168.1.1 TRAP-TEST-MIB::demotraps localhost 6 17 '' SNMPv2-MIB::sysLocation.0 s "Skinny is ready to rock"