send SNMP trap via command

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
iptribe
Posts: 52
Joined: Sun Aug 31, 2014 11:03 am

send SNMP trap via command

Post 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"
mp4783
Posts: 116
Joined: Wed May 14, 2014 11:11 am

Re: send SNMP trap via command

Post 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.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: send SNMP trap via command

Post by tgriep »

Have you gone through this procedure on your Nagios XI server?
http://assets.nagios.com/downloads/nagi ... ios_XI.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
iptribe
Posts: 52
Joined: Sun Aug 31, 2014 11:03 am

Re: send SNMP trap via command

Post 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?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: send SNMP trap via command

Post 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?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: send SNMP trap via command

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
iptribe
Posts: 52
Joined: Sun Aug 31, 2014 11:03 am

Re: send SNMP trap via command

Post by iptribe »

Thanks guy! I have managed to receive the trap by adding in the EVENT inside snmptt.conf!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: send SNMP trap via command

Post by tmcdonald »

I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked