Nagios XI R2.9 SNMP traps receive shows "Waiting for trap.."
Nagios XI R2.9 SNMP traps receive shows "Waiting for trap.."
I followed the instructions in http://assets.nagios.com/downloads/nagi ... ios_XI.pdf. No errors.
Created a device and added the SNMP Trap service to it. Under the status information, it only says "Waiting for trap...".
I checked /var/log/messages and /var/log/snmp/snmptt.log and I see the snmp traps coming in.
I am using snmptt-1.4-0.9.beta2.el6.noarch. I tried using snmptt-1.3-3.nagios.noarch.rpm but when I did, it didn't add the snmptt user and the script failed when trying to add that user to the nagcmd and nagios group.
Created a device and added the SNMP Trap service to it. Under the status information, it only says "Waiting for trap...".
I checked /var/log/messages and /var/log/snmp/snmptt.log and I see the snmp traps coming in.
I am using snmptt-1.4-0.9.beta2.el6.noarch. I tried using snmptt-1.3-3.nagios.noarch.rpm but when I did, it didn't add the snmptt user and the script failed when trying to add that user to the nagcmd and nagios group.
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Nagios XI R2.9 SNMP traps receive shows "Waiting for tra
Well, let's start of with some basic information and move on from there. Also I should ask, are you presently on 1.3 or 1.4? I would suggest the latter.
Versions installed
Looking for bins:
snmptt\trapd settings and user perms:
Checking log and spool dirs:
Versions installed
Code: Select all
rpm -qa | grep snmpCode: Select all
ls -lva /usr/local/bin | grep -i 'snmp\|addmib'
ls -lva /usr/local/sbin | grep -i 'snmp\|addmib'
ls -lva /usr/sbin | grep -i 'snmp\|addmib'
cat /etc/snmp/snmptrapd.confCode: Select all
grep -i 'daemon_uid\|mode =' /etc/snmp/snmptt.ini
grep -i 'exec' /etc/snmp/snmptt.conf | tail -n 10
grep -i 'nag' /etc/group
grep -i 'snmp' /etc/groupCode: Select all
ll /var/log/snmptt/
ll -d /var/log/snmptt/
ll /var/spool/snmptt
ll -d /var/spool/snmpttNagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Nagios XI R2.9 SNMP traps receive shows "Waiting for tra
# rpm -qa | grep snmp
So running snmptt-1.4-0.9.beta2.el6.noarch
# ls -lva /usr/local/bin/ | grep -i 'snmp\|addmib'
No bins matching in /usr/local/sbin
# ls -lva /usr/sbin | grep -i 'snmp\|addmib'
# cat /etc/snmp/snmptrapd.conf
# grep -i 'daemon_uid\|mode =' /etc/snmp/snmptt.ini
# grep -i 'exec' /etc/snmp/snmptt.conf | tail -n 10
# grep -i 'nag' /etc/group
# grep -i 'snmp' /etc/group
# ll /var/log/snmptt/
# ll -d /var/log/snmptt/
# ll /var/spool/snmptt
# ll -d /var/spool/snmptt
# tail /var/log/snmptt/snmptt.log
In Nagios, the device had a domain at the end of it and I noticed in the log above it didn't, so I renamed the device in Nagios and that didn't fix it. I also added in the snmptt.ini the domains to strip just in case.
Code: Select all
net-snmp-utils-5.5-49.el6_5.1.x86_64
snmptt-1.4-0.9.beta2.el6.noarch
net-snmp-libs-5.5-49.el6_5.1.x86_64
net-snmp-perl-5.5-49.el6_5.1.x86_64
net-snmp-5.5-49.el6_5.1.x86_64
php-snmp-5.3.3-27.el6_5.x86_64
# ls -lva /usr/local/bin/ | grep -i 'snmp\|addmib'
Code: Select all
-rwxr-xr-x 1 root nagios 804 Apr 3 12:09 addmib
-rwxr-xr-x 1 root root 2078 Apr 3 12:09 snmptraphandling.py
-rwxr-xr-x 1 root root 30438 Apr 3 12:09 snmpttconvertmib
# ls -lva /usr/sbin | grep -i 'snmp\|addmib'
Code: Select all
-rwxr-xr-x. 1 root root 30744 Mar 6 12:51 snmpd
-rwxr-xr-x. 1 root root 30776 Mar 6 12:51 snmptrapd
-rwxr-xr-x 1 root root 177466 Oct 22 2012 snmptt
-rwxr-xr-x 1 root root 6493 Oct 22 2012 snmptthandler
Code: Select all
disableAuthorization yes
traphandle default /usr/sbin/snmptthandler
Code: Select all
mode = daemon
description_mode = 0
# A second (child) process will be started as the daemon_uid user so
daemon_uid = snmptt
Code: Select all
#EXEC qpage -f TRAP notifygroup1 "Device reinitialized (coldStart)"
#EXEC qpage -f TRAP notifygroup1 "Device reinitialized (warmStart)"
#EXEC qpage -f TRAP notifygroup1 "Link down on interface $1. Admin state: $2. Operational state: $3"
#EXEC qpage -f TRAP notifygroup1 "Link up on interface $1. Admin state: $2. Operational state: $3"
#EXEC qpage -f TRAP notifygroup1 "SNMP authentication failure"
Code: Select all
nagios:x:501:nagios,apache,snmptt
nagcmd:x:502:nagios,apache,snmptt
Code: Select all
nagios:x:501:nagios,apache,snmptt
nagcmd:x:502:nagios,apache,snmptt
snmptt:x:489:
Code: Select all
total 36
-rw-rw-r-- 1 snmptt snmptt 8252 Apr 3 14:07 snmptt.log
-rw-rw-r-- 1 snmptt snmptt 4679 Apr 3 13:52 snmpttsystem.log
-rw-rw-r-- 1 snmptt root 13863 Apr 3 13:58 snmpttunknown.log
Code: Select all
drwxrwxr-x 2 snmptt snmptt 4096 Apr 3 12:19 /var/log/snmptt/
Code: Select all
total 0
Code: Select all
drwxrwxr-x 2 snmptt snmptt 4096 Apr 3 14:07 /var/spool/snmptt
# tail /var/log/snmptt/snmptt.log
Code: Select all
Thu Apr 3 14:13:34 2014 .1.3.6.1.6.3.1.1.5.3 Critical "Status Events" testswitch - Link down on interface 10101. Admin state: GigabitEthernet1/0/1. Operational state: ethernetCsmacd
Thu Apr 3 14:13:49 2014 .1.3.6.1.6.3.1.1.5.4 Normal "Status Events" testswitch - Link up on interface 10101. Admin state: GigabitEthernet1/0/1. Operational state: ethernetCsmacd
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Nagios XI R2.9 SNMP traps receive shows "Waiting for tra
The reason you are not getting these in the nagios interface, but they are considered known traps, is that these two traps do not have proper exec lines within snmptt.conf.
# grep -i 'exec' /etc/snmp/snmptt.conf | tail -n 10
On my system that same command looks like:
A simple way to resolve this would be to add exec lines directly under the commented out ones, something like this should do:
You then need to restart snmptt with: service snmptt restart
# grep -i 'exec' /etc/snmp/snmptt.conf | tail -n 10
Code: Select all
#EXEC qpage -f TRAP notifygroup1 "Device reinitialized (coldStart)"
#EXEC qpage -f TRAP notifygroup1 "Device reinitialized (warmStart)"
#EXEC qpage -f TRAP notifygroup1 "Link down on interface $1. Admin state: $2. Operational state: $3"
#EXEC qpage -f TRAP notifygroup1 "Link up on interface $1. Admin state: $2. Operational state: $3"
#EXEC qpage -f TRAP notifygroup1 "SNMP authentication failure"Code: Select all
#EXEC qpage -f TRAP notifygroup1 "Device reinitialized (coldStart)"
#EXEC qpage -f TRAP notifygroup1 "Device reinitialized (warmStart)"
#EXEC qpage -f TRAP notifygroup1 "Link down on interface $1. Admin state: $2. Operational state: $3"
#EXEC qpage -f TRAP notifygroup1 "Link up on interface $1. Admin state: $2. Operational state: $3"
#EXEC qpage -f TRAP notifygroup1 "SNMP authentication failure"
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "The SNMP trap that is generated as a result of an event with the host $*"
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "The SNMP trap that is generated as a result of an event requiring $*"
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "The SNMP trap that is generated as a result of an event with the service $*"
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "The SNMP trap that is generated as a result of an event requiring $*"Code: Select all
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "Link down on interface $1. Admin state: $2. Operational state: $3"
AND
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "$-*" "Link up on interface $1. Admin state: $2. Operational state: $3"Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Nagios XI R2.9 SNMP traps receive shows "Waiting for tra
Worked!
Note: with the domain names stripped, the alarm wouldn't stay and would get a
without another trap received.
So I renamed the device back with the domain and turned off domain stripping in snmptt.ini and now the alarms stay.
Thank you very much for your help!
Note: with the domain names stripped, the alarm wouldn't stay and would get a
Code: Select all
SERVICE ALERT: testswitch;SNMP Traps;OK;HARD;1;OK: TRAP RESETSo I renamed the device back with the domain and turned off domain stripping in snmptt.ini and now the alarms stay.
Thank you very much for your help!