SNMP Traps Set up issue
Posted: Thu Jan 17, 2013 8:02 pm
Hi guys, I need suggestions regarding setting up the SNMP trap on Nagios XI.
I am flowing up the document “Nagios XI - Integrating SNMP Traps”, but it does not help.
I tried to send a test SNMP trap from the HP Onboard Administrator (HP Blade Enclosure C7000) to Nagios XI with the community string 0nT1m3Run or public, the CentOS received it, however the no log were showing on SNMPtrapd and SNMPTT. Nagios Trap Service showed no event.
[root@localhost snmptt]# tcpdump dst port 162
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
09:47:07.731557 IP 10.161.166.140.remote-as > 10.161.170.64.snmptrap: C=0nT1m3Run Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630271911 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:07.731698 IP 10.161.166.140.brvread > 10.161.170.64.snmptrap: Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630271911 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:19.168925 IP 10.161.166.140.remote-as > 10.161.170.64.snmptrap: C=0nT1m3Run Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630273056 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:19.169577 IP 10.161.166.140.brvread > 10.161.170.64.snmptrap: Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630273056 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:51.160089 IP 10.161.166.140.remote-as > 10.161.170.64.snmptrap: C=0nT1m3Run Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630276255 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:51.162815 IP 10.161.166.140.brvread > 10.161.170.64.snmptrap: Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630276255 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
[root@localhost snmptt]# tcpdump dst port 162
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
09:47:07.731557 IP 10.161.166.140.remote-as > 10.161.170.64.snmptrap: C=0nT1m3Run Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630271911 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:07.731698 IP 10.161.166.140.brvread > 10.161.170.64.snmptrap: Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630271911 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:19.168925 IP 10.161.166.140.remote-as > 10.161.170.64.snmptrap: C=0nT1m3Run Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630273056 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:19.169577 IP 10.161.166.140.brvread > 10.161.170.64.snmptrap: Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630273056 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
^C
6 packets captured
967 packets received by filter
833 packets dropped by kernel
170 packets dropped by interface
Nagios Trap Service shows nothing on the host. BTW, the TRAP Service was set up from the SNMP TRAP wizard.
SNMPTT Logs:
[root@localhost snmptt]# ls -la
total 32
drwxr-xr-x 2 root root 4096 Jan 10 11:00 .
drwxr-xr-x. 8 root root 4096 Jan 17 16:13 ..
-rw-r--r-- 1 root root 0 Jan 10 11:00 snmptt.log
-rw-r--r-- 1 root root 18972 Oct 31 10:15 snmpttsystem.log
-rw-r--r-- 1 root root 0 Jan 10 11:00 snmpttunknown.log
You can see, no logs are updated at all.
SNMPTRAPD Log:
[root@localhost snmptt]# cat /var/log/net-snmpd.log
NET-SNMP version 5.5
[root@localhost snmptt]#
Here are some configuration files regarding snmptrapd:
1. Snmptrapd.conf (under /etc/snmp)
disableAuthorization yes
traphandle default /usr/sbin/snmptt
#donotlogtraps yes
authCommunity log,execute,net public
authCommunity log,execute,net 0nT1m3Run
createUser MTM MD5 tcms2009 DES tcms2009
authUser log,execute,net MTM
2. Snmptrapd (under /etc/rc.d/init.d)
#!/bin/bash
# ucd-snmp init file for snmptrapd
#
# chkconfig: - 50 50
# description: Simple Network Management Protocol (SNMP) Trap Daemon
#
# processname: /usr/sbin/snmptrapd
# config: /etc/snmp/snmptrapd.conf
# config: /usr/share/snmp/snmptrapd.conf
# pidfile: /var/run/snmptrapd.pid
### BEGIN INIT INFO
# Provides: snmptrapd
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: start and stop Net-SNMP trap daemon
# Description: Simple Network Management Protocol (SNMP) trap daemon
### END INIT INFO
# source function library
. /etc/init.d/functions
OPTIONS="-Lsd -On -p /var/run/snmptrapd.pid"
if [ -e /etc/sysconfig/snmptrapd ]; then
. /etc/sysconfig/snmptrapd
fi
RETVAL=0
prog="snmptrapd"
binary=/usr/sbin/snmptrapd
pidfile=/var/run/snmptrapd.pid
start() {
[ -x $binary ] || exit 5
echo -n $"Starting $prog: "
daemon --pidfile=$pidfile /usr/sbin/snmptrapd $OPTIONS
RETVAL=$?
echo
touch /var/lock/subsys/snmptrapd
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc -On -p $pidfile /usr/sbin/snmptrapd
RETVAL=$?
echo
rm -f /var/lock/subsys/snmptrapd
return $RETVAL
}
reload(){
stop
start
}
restart(){
stop
start
}
condrestart(){
[ -e /var/lock/subsys/snmptrapd ] && restart
return 0
}
case "$1" in
start)
start
RETVAL=$?
;;
stop)
stop
RETVAL=$?
;;
restart)
restart
RETVAL=$?
;;
reload|force-reload)
reload
RETVAL=$?
;;
condrestart|try-restart)
condrestart
RETVAL=$?
;;
status)
status snmptrapd
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
RETVAL=2
esac
exit $RETVAL
3. 10.161.166.140.cfg (under /usr/local/ngaios/etc/services) --- HP Onboard Administrator
###############################################################################
#
# Service configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date: 2013-01-16 23:53:31
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################
define service {
host_name 10.161.166.140
service_description TRAP
use xiwizard_snmptrap_service
is_volatile 1
max_check_attempts 1
check_interval 1
retry_interval 1
active_checks_enabled 0
passive_checks_enabled 1
check_period xi_timeperiod_24x7
notification_interval 1
notification_period xi_timeperiod_24x7
notification_options w,c,u,
notifications_enabled 1
contacts nagiosadmin
stalking_options o,w,c,u,
icon_image snmptrap.png
_xiwizard snmp_trap
register 1
}
define service {
host_name 10.161.166.140
service_description Uptime
use xiwizard_snmp_service
check_command check_xi_service_snmp! -o sysUpTime.0 -C 0nT1m3Run -P 2c
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard snmp
register 1
}
###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
4. Submit_check_result script (under /usr/local/ngaios/libexec/eventhandlers permission: -rwxr-xr-x 1 root root 1182 Jan 9 11:09)
All SNMPD, SNMPTRAPD and SNMPTT services are running on Nagios.
[root@localhost ~]# ps -ef | grep snmpd
root 4371 1 0 11:14 ? 00:00:00 /usr/sbin/snmpd -LS0-6d -Lf /dev/null -p /var/run/snmpd.pid
root 4952 2936 0 11:15 pts/0 00:00:00 grep snmpd
[root@localhost ~]# ps -ef | grep snmptt
root 1458 1 0 11:11 ? 00:00:00 /usr/bin/perl /usr/local/sbin/snmptt --daemon
snmptt 1460 1458 0 11:11 ? 00:00:00 /usr/bin/perl /usr/local/sbin/snmptt --daemon
root 4980 2936 0 11:15 pts/0 00:00:00 grep snmptt
[root@localhost ~]# ps -ef | grep snmptrapd
root 1449 1 0 11:11 ? 00:00:00 /usr/sbin/snmptrapd -On -Lsd -p /var/run/snmptrapd.pid
root 5118 2936 0 11:15 pts/0 00:00:00 grep snmptrapd
You have new mail in /var/spool/mail/root
[root@localhost ~]#
Here are more info:
OS : CentOS release 6.3 (Final)
Nagios XI : 2012 R1.3
NET-SNMP : Ver 5.5 (snmpd & snmptrapd)
SNMPTT : Ver 1.3
Perl: Ver 5.17.4
SNMP community string: 0nT1m3Run
The problem is that the trap arrived at the CentOS (hence not the firewall issue), but snmptrapd does not get and log it. Hence, the snmptt could not get it too.
Can someone shed me a light? Thanks so much!!
Patrick
I am flowing up the document “Nagios XI - Integrating SNMP Traps”, but it does not help.
I tried to send a test SNMP trap from the HP Onboard Administrator (HP Blade Enclosure C7000) to Nagios XI with the community string 0nT1m3Run or public, the CentOS received it, however the no log were showing on SNMPtrapd and SNMPTT. Nagios Trap Service showed no event.
[root@localhost snmptt]# tcpdump dst port 162
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
09:47:07.731557 IP 10.161.166.140.remote-as > 10.161.170.64.snmptrap: C=0nT1m3Run Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630271911 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:07.731698 IP 10.161.166.140.brvread > 10.161.170.64.snmptrap: Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630271911 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:19.168925 IP 10.161.166.140.remote-as > 10.161.170.64.snmptrap: C=0nT1m3Run Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630273056 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:19.169577 IP 10.161.166.140.brvread > 10.161.170.64.snmptrap: Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630273056 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:51.160089 IP 10.161.166.140.remote-as > 10.161.170.64.snmptrap: C=0nT1m3Run Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630276255 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:51.162815 IP 10.161.166.140.brvread > 10.161.170.64.snmptrap: Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630276255 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
[root@localhost snmptt]# tcpdump dst port 162
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
09:47:07.731557 IP 10.161.166.140.remote-as > 10.161.170.64.snmptrap: C=0nT1m3Run Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630271911 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:07.731698 IP 10.161.166.140.brvread > 10.161.170.64.snmptrap: Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630271911 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:19.168925 IP 10.161.166.140.remote-as > 10.161.170.64.snmptrap: C=0nT1m3Run Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630273056 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
09:47:19.169577 IP 10.161.166.140.brvread > 10.161.170.64.snmptrap: Trap(155) E:232 10.161.166.140 enterpriseSpecific s=11003 1630273056 system.sysName.0="OA-D8D3856129A3" E:232.11.2.11.1=0 E:232.11.2.8.1="HP Onboard Administrator Test Trap sent from enclosure: VVFAT"
^C
6 packets captured
967 packets received by filter
833 packets dropped by kernel
170 packets dropped by interface
Nagios Trap Service shows nothing on the host. BTW, the TRAP Service was set up from the SNMP TRAP wizard.
SNMPTT Logs:
[root@localhost snmptt]# ls -la
total 32
drwxr-xr-x 2 root root 4096 Jan 10 11:00 .
drwxr-xr-x. 8 root root 4096 Jan 17 16:13 ..
-rw-r--r-- 1 root root 0 Jan 10 11:00 snmptt.log
-rw-r--r-- 1 root root 18972 Oct 31 10:15 snmpttsystem.log
-rw-r--r-- 1 root root 0 Jan 10 11:00 snmpttunknown.log
You can see, no logs are updated at all.
SNMPTRAPD Log:
[root@localhost snmptt]# cat /var/log/net-snmpd.log
NET-SNMP version 5.5
[root@localhost snmptt]#
Here are some configuration files regarding snmptrapd:
1. Snmptrapd.conf (under /etc/snmp)
disableAuthorization yes
traphandle default /usr/sbin/snmptt
#donotlogtraps yes
authCommunity log,execute,net public
authCommunity log,execute,net 0nT1m3Run
createUser MTM MD5 tcms2009 DES tcms2009
authUser log,execute,net MTM
2. Snmptrapd (under /etc/rc.d/init.d)
#!/bin/bash
# ucd-snmp init file for snmptrapd
#
# chkconfig: - 50 50
# description: Simple Network Management Protocol (SNMP) Trap Daemon
#
# processname: /usr/sbin/snmptrapd
# config: /etc/snmp/snmptrapd.conf
# config: /usr/share/snmp/snmptrapd.conf
# pidfile: /var/run/snmptrapd.pid
### BEGIN INIT INFO
# Provides: snmptrapd
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: start and stop Net-SNMP trap daemon
# Description: Simple Network Management Protocol (SNMP) trap daemon
### END INIT INFO
# source function library
. /etc/init.d/functions
OPTIONS="-Lsd -On -p /var/run/snmptrapd.pid"
if [ -e /etc/sysconfig/snmptrapd ]; then
. /etc/sysconfig/snmptrapd
fi
RETVAL=0
prog="snmptrapd"
binary=/usr/sbin/snmptrapd
pidfile=/var/run/snmptrapd.pid
start() {
[ -x $binary ] || exit 5
echo -n $"Starting $prog: "
daemon --pidfile=$pidfile /usr/sbin/snmptrapd $OPTIONS
RETVAL=$?
echo
touch /var/lock/subsys/snmptrapd
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc -On -p $pidfile /usr/sbin/snmptrapd
RETVAL=$?
echo
rm -f /var/lock/subsys/snmptrapd
return $RETVAL
}
reload(){
stop
start
}
restart(){
stop
start
}
condrestart(){
[ -e /var/lock/subsys/snmptrapd ] && restart
return 0
}
case "$1" in
start)
start
RETVAL=$?
;;
stop)
stop
RETVAL=$?
;;
restart)
restart
RETVAL=$?
;;
reload|force-reload)
reload
RETVAL=$?
;;
condrestart|try-restart)
condrestart
RETVAL=$?
;;
status)
status snmptrapd
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
RETVAL=2
esac
exit $RETVAL
3. 10.161.166.140.cfg (under /usr/local/ngaios/etc/services) --- HP Onboard Administrator
###############################################################################
#
# Service configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date: 2013-01-16 23:53:31
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################
define service {
host_name 10.161.166.140
service_description TRAP
use xiwizard_snmptrap_service
is_volatile 1
max_check_attempts 1
check_interval 1
retry_interval 1
active_checks_enabled 0
passive_checks_enabled 1
check_period xi_timeperiod_24x7
notification_interval 1
notification_period xi_timeperiod_24x7
notification_options w,c,u,
notifications_enabled 1
contacts nagiosadmin
stalking_options o,w,c,u,
icon_image snmptrap.png
_xiwizard snmp_trap
register 1
}
define service {
host_name 10.161.166.140
service_description Uptime
use xiwizard_snmp_service
check_command check_xi_service_snmp! -o sysUpTime.0 -C 0nT1m3Run -P 2c
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts nagiosadmin
_xiwizard snmp
register 1
}
###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
4. Submit_check_result script (under /usr/local/ngaios/libexec/eventhandlers permission: -rwxr-xr-x 1 root root 1182 Jan 9 11:09)
All SNMPD, SNMPTRAPD and SNMPTT services are running on Nagios.
[root@localhost ~]# ps -ef | grep snmpd
root 4371 1 0 11:14 ? 00:00:00 /usr/sbin/snmpd -LS0-6d -Lf /dev/null -p /var/run/snmpd.pid
root 4952 2936 0 11:15 pts/0 00:00:00 grep snmpd
[root@localhost ~]# ps -ef | grep snmptt
root 1458 1 0 11:11 ? 00:00:00 /usr/bin/perl /usr/local/sbin/snmptt --daemon
snmptt 1460 1458 0 11:11 ? 00:00:00 /usr/bin/perl /usr/local/sbin/snmptt --daemon
root 4980 2936 0 11:15 pts/0 00:00:00 grep snmptt
[root@localhost ~]# ps -ef | grep snmptrapd
root 1449 1 0 11:11 ? 00:00:00 /usr/sbin/snmptrapd -On -Lsd -p /var/run/snmptrapd.pid
root 5118 2936 0 11:15 pts/0 00:00:00 grep snmptrapd
You have new mail in /var/spool/mail/root
[root@localhost ~]#
Here are more info:
OS : CentOS release 6.3 (Final)
Nagios XI : 2012 R1.3
NET-SNMP : Ver 5.5 (snmpd & snmptrapd)
SNMPTT : Ver 1.3
Perl: Ver 5.17.4
SNMP community string: 0nT1m3Run
The problem is that the trap arrived at the CentOS (hence not the firewall issue), but snmptrapd does not get and log it. Hence, the snmptt could not get it too.
Can someone shed me a light? Thanks so much!!
Patrick