SNMP Traps - Can't get description in email alert

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
00_kl250
Posts: 63
Joined: Tue Apr 16, 2013 7:26 am

SNMP Traps - Can't get description in email alert

Post by 00_kl250 »

Hey All,

I'm having issues with SNMP traps and alerting properly, particularity with the event description not being passed in the alert message. Traps are coming in fine to nagios and i'm getting the alert, but i'm getting an alert message in email and the nagios web interface that says:

***** Nagios *****

Notification Type: PROBLEM

Service: TRAP
Host: xxxx
Address: xxxxxx
State: WARNING

Date/Time: Thu Feb 28 09:20:25 CST 2019

Additional Info:

notAlarmedNonServiceAffecting Object:ne Index:1 Slot:0 Port:unknown AID:SYSTEM

However, when looking at the snmptt.log it shows the following:


Thu Feb 28 09:20:19 2019 logoutOfUser Normal "Status Events" [xxhostnamexx] - notAlarmedNonServiceAffecting Object:ne Index:1 Slot:0 Port:unknown AID:SYSTEM


Question:
1). How do i get it to pass the "logoutOfUser" instead of everything after the hostname? The not notAlarmedNonServiceAffecting part really isn't helpful to me.

I've been beating my head around the bush for the past couple of days to get to this point but need some help if anyone has ideas. Thank you in advance!
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: SNMP Traps - Can't get description in email alert

Post by cdienger »

If you look in this file you probably have something similar to:

Code: Select all

EVENT logoutOfUser .1.3.6.1.4.1.18372... "Status Events" Normal
FORMAT ...
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "... $*"
SDESC
...
Variables:
...
EDESC
logoutOfUser is likely the event name defined in /etc/snmptt.ini. The EXEC line determines what is sent to Nagios and I think adding $N(event name) will do the trick.

EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "$N: ... $*"

More info - including variables - on snmptt: http://snmptt.sourceforge.net/docs/snmp ... ile-format
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
00_kl250
Posts: 63
Joined: Tue Apr 16, 2013 7:26 am

Re: SNMP Traps - Can't get description in email alert

Post by 00_kl250 »

Thank you, this did the trick!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SNMP Traps - Can't get description in email alert

Post by scottwilkerson »

00_kl250 wrote:Thank you, this did the trick!
Great!

Locking thread
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked