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!
SNMP Traps - Can't get description in email alert
Re: SNMP Traps - Can't get description in email alert
If you look in this file you probably have something similar to:
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
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
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.
Re: SNMP Traps - Can't get description in email alert
Thank you, this did the trick!
-
- 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
Great!00_kl250 wrote:Thank you, this did the trick!
Locking thread