SNMP Waiting for traps

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
gwijnant
Posts: 37
Joined: Tue Sep 08, 2015 4:22 am

Re: SNMP Waiting for traps

Post by gwijnant »

Hi tgriep,

I moved the file and still the same output:

[root@localhost ~]# snmptranslate -Td 1.3.6.1.4.1.9.9.305.1.3.5.0.2
SNMPv2-SMI::enterprises.9.9.305.1.3.5.0.2
enterprises OBJECT-TYPE
-- FROM SNMPv2-SMI, RFC1155-SMI
::= { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) 9 9 305 1 3 5 0 2 }
[root@localhost ~]#

I deleted the file for 2nd test and still same outcome.
Ofcourse after moving and deleting the file and before testing I restarted the snmptrapd and the snmptt service.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: SNMP Waiting for traps

Post by tgriep »

Can you create this file

Code: Select all

/etc/snmp/snmp.conf
Add the following line to it

Code: Select all

mibs +ALL
Save it and run the snmptranslate to see if it works.
Be sure to check out our Knowledgebase for helpful articles and solutions!
gwijnant
Posts: 37
Joined: Tue Sep 08, 2015 4:22 am

Re: SNMP Waiting for traps

Post by gwijnant »

Hi tgriep,

Hope you had a good weekend :d
This gives me following output:

Mon Mar 7 16:44:26 2016: Unknown trap (Dying Gasp - Shutdown due to power loss) received from 10.1.254.253 at:
Value 0: 10.1.254.253
Value 1: 10.1.254.253
Value 2: CISCO-SYSTEM-EXT-MIB::cseShutDownNotify
Value 3: Dying Gasp - Shutdown due to power loss
Value 4: 10.1.254.253
Value 5:
Value 6:
Value 7:
Value 8:
Value 9:
Value 10:

[root@localhost ~]# snmptranslate -Td 1.3.6.1.4.1.9.9.305.1.3.5.0.2
CISCO-SYSTEM-EXT-MIB::cseShutDownNotify
cseShutDownNotify NOTIFICATION-TYPE
-- FROM CISCO-SYSTEM-EXT-MIB
OBJECTS { cseHaShutDownReason }
DESCRIPTION "A system shutdown notification is generated
whenever a system is going to shut down. The
cseHaShutDownReason, describes the reason as to
why the system is going to go down."
::= { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) cisco(9) ciscoMgmt(9) ciscoSystemExtMIB(305) ciscoSystemExtMIBObjects(1) ciscoHaGroup(3) cseHaNotification(5) cseHaNotificationPrefix(0) 2 }
[root@localhost ~]#

In the snmpttunknown.log I see this output:

Mon Mar 7 16:44:26 2016: Unknown trap (Dying Gasp - Shutdown due to power loss) received from 10.1.254.253 at:
Value 0: 10.1.254.253
Value 1: 10.1.254.253
Value 2: CISCO-SYSTEM-EXT-MIB::cseShutDownNotify
Value 3: Dying Gasp - Shutdown due to power loss
Value 4: 10.1.254.253
Value 5:
Value 6:
Value 7:
Value 8:
Value 9:
Value 10:

Betst Regards,

Guy
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: SNMP Waiting for traps

Post by tmcdonald »

Our SNMP experts are out of the office today, but I'll make sure they take a look at this again tomorrow!
Former Nagios employee
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: SNMP Waiting for traps

Post by tgriep »

The settings for that trap are not in the /etc/snmp/snmptt.conf file, that us why they are showing up in the unknown log.
If you add the following to that file.

Code: Select all

EVENT cseShutDownNotify .1.3.6.1.4.1.9.9.305.1.3.5.0.2 "Status Events" Normal
FORMAT A system shutdown notification is generated $*
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "A system shutdown notification is generated $*"
SDESC
A system shutdown notification is generated
whenever a system is going to shut down. The
cseHaShutDownReason, describes the reason as to
why the system is going to go down.
Variables:
  1: cseHaShutDownReason
EDESC
Then restart the snmptt daemon,

Code: Select all

service snmptt restart
Those traps will show up in Nagios XI under Admin > Unconfigured Objects the first time they are received so they can be configured.

There is an application you can use to add the OID's to the /etc/snmp/snmptt.conf file, it is called addmib.
Just run it like below to add the traps from a MIB file to the snmptt.conf file. Restart the snmptt daemon and the system will start to receive the traps in that MIB file.

Code: Select all

addmib <mibfile>
Be sure to check out our Knowledgebase for helpful articles and solutions!
gwijnant
Posts: 37
Joined: Tue Sep 08, 2015 4:22 am

Re: SNMP Waiting for traps

Post by gwijnant »

Hi tgriep,

I still get the trap in the unknown logfile:

Tue Mar 15 14:35:41 2016: Unknown trap (Dying Gasp - Shutdown due to power loss) received from 10.1.254.253 at:
Value 0: 10.1.254.253
Value 1: 10.1.254.253
Value 2: CISCO-SYSTEM-EXT-MIB::cseShutDownNotify
Value 3: Dying Gasp - Shutdown due to power loss
Value 4: 10.1.254.253
Value 5:
Value 6:
Value 7:
Value 8:
Value 9:
Value 10:


I dont seen anything in the nagios Unconfigured Object page.

Best Regards
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: SNMP Waiting for traps

Post by tgriep »

Can you post your latest /etc/snmp/snmptt.conf file and the /etc/snmp/snmpt.ini files?
Can you run the following command and post the output here?

Code: Select all

ps -ef |grep snmp
Thanks.
Be sure to check out our Knowledgebase for helpful articles and solutions!
gwijnant
Posts: 37
Joined: Tue Sep 08, 2015 4:22 am

Re: SNMP Waiting for traps

Post by gwijnant »

Hi tgriep,

In attachment the 2 files.

[root@localhost ~]# ps -ef |grep snmp
root 12697 1 0 13:02 ? 00:00:00 /usr/sbin/snmptrapd -Lsd -p /var/run/snmptrapd.pid
root 14304 1 0 13:03 ? 00:00:00 /usr/bin/perl /usr/sbin/snmptt --daemon
snmptt 14306 14304 0 13:03 ? 00:00:00 /usr/bin/perl /usr/sbin/snmptt --daemon
root 14348 16165 0 13:03 pts/0 00:00:00 grep snmp

Best regards
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: SNMP Waiting for traps

Post by tgriep »

In your EXEC line for that trap

Code: Select all

EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Dying Gasp" "$s" "$@" "$-*" "A system shutdown notification is generated $*"
The second option is the name of the service that the trap will be received to in XI. If they do not match, It may not receive it.
Do you have a service defined as "SNMP Dying Gasp" in XI?
If not, you should define it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
gwijnant
Posts: 37
Joined: Tue Sep 08, 2015 4:22 am

Re: SNMP Waiting for traps

Post by gwijnant »

Hi tgriep

I changed the EXEC line to the following:

Code: Select all

EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "A system shutdown notification is generated $*"
Still trap is showing up in the smpttunknown.log file and nothing is in the Unconfigured Objects list.

[root@lcoalhost ~]# tailf /var/log/snmptt/snmpttunknown.log
Thu Mar 17 10:59:21 2016: Unknown trap (Dying Gasp - Shutdown due to power loss) received from 10.1.254.253 at:
Value 0: 10.1.254.253
Value 1: 10.1.254.253
Value 2: CISCO-SYSTEM-EXT-MIB::cseShutDownNotify
Value 3: Dying Gasp - Shutdown due to power loss
Value 4: 10.1.254.253
Value 5:
Value 6:
Value 7:
Value 8:
Value 9:
Value 10:
Locked