Page 1 of 1
send SNMP trap via command
Posted: Mon Mar 09, 2015 9:37 am
by iptribe
Hi Support,
I have tried to send a SNMP trap via command line, but my Nagios can't receive the trap. Is my command correct?
snmptrap -v 2c -c public 192.168.1.1 '' NAGIOS-NOTIFY-MIB::nSvcNotify nSvcOutput s "HI"
Re: send SNMP trap via command
Posted: Mon Mar 09, 2015 9:53 am
by mp4783
Is SNMP trapping configured? Are you receiving other SNMP traps?
An easy set would be the following:
telnet 192.168.1.1 162
If you get a "Connection refused" message, then the trap receiver is not present. You can also use nmap to probe for the SNMP trap TCP port 162.
Re: send SNMP trap via command
Posted: Mon Mar 09, 2015 2:32 pm
by tgriep
Have you gone through this procedure on your Nagios XI server?
http://assets.nagios.com/downloads/nagi ... ios_XI.pdf
Re: send SNMP trap via command
Posted: Tue Mar 10, 2015 7:58 am
by iptribe
Hi All,
I did follow the tutorial to configure the snmp trap. I am trying to send a trap from remoter server(192.168.1.199) to my nagios server (192.168.1.199) via command line (snmptrap -v 2c -c public 192.168.1.199 '' NAGIOS-NOTIFY-MIB::nSvcNotify nSvcOutput s "HI"), and from the snmpttunknown.log I can see the trap is inside the log.
Tue Mar 10 20:51:29 2015: Unknown trap (.1.3.6.1.4.1.20006.1.8) received from 192.168.1.109 at:
Value 0: 192.168.1.109
Value 1: 192.168.1.109
Value 2: 4:6:49:24.57
Value 3: .1.3.6.1.4.1.20006.1.8
Value 4: 192.168.1.109
Value 5:
Value 6:
Value 7:
Value 8:
Value 9:
Value 10:
Ent Value 0: .1.3.6.1.4.1.20006.1.3.1.17=HI
How am I able to send a critical alarm via alarm, any idea?
Re: send SNMP trap via command
Posted: Tue Mar 10, 2015 9:15 am
by jdalrymple
Did you read through the document tgriep linked to?
http://assets.nagios.com/downloads/nagi ... ios_XI.pdf
It outlines how to adjust severity for traps. Is that the information you're looking for?
Re: send SNMP trap via command
Posted: Tue Mar 10, 2015 5:34 pm
by Box293
This gets kinda complicated.
You need to have an EVENT in your /etc/snmp/snmptt.conf or a trap processed mib file.
Have a read of this post to see if it helps at all.
http://support.nagios.com/forum/viewtop ... 81#p123119
Re: send SNMP trap via command
Posted: Thu Mar 19, 2015 8:22 am
by iptribe
Thanks guy! I have managed to receive the trap by adding in the EVENT inside snmptt.conf!
Re: send SNMP trap via command
Posted: Thu Mar 19, 2015 9:44 am
by tmcdonald
I'll be closing this thread now, but feel free to open another if you need anything in the future!