lets define MIB file in TRAP-TEST-MIB.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"
::= 117
END
lets start snmptrapd to recieve trap
snmptrapd -c snmptrapd.conf -A -n -f -Lo -M D:\snmp_trap_example\mibs -m +TRAP-TEST-MIB
lets send trap
snmptrap -M D:\snmp_trap_example\mibs -m +TRAP-TEST-MIB -v 2c -c public localhost 0 TRAP-TEST-MIB::demotraps SNMPv2-MIB::sysLocation.0 s "Hey, man!"