Nagios and snmp traps problem .

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
sun4o
Posts: 2
Joined: Sun Dec 02, 2012 9:27 am

Nagios and snmp traps problem .

Post by sun4o »

Hi guys ! I`m trying to receive SNMP traps with Nagios and snmptt , but I have some problems, and I don't know what to do. Nagios Core 3.4.1 , installed on CentOS 6.3 . Net-snmp, snmptt, net-snmp-perlmod are installed also . Successfully converted mib file for host that I want to monitor, and converted snmptt.conf.host file has path to submit_check_results eventhandler . Now, snmptt receive the snmp trap from host, and everything is ok, but Nagios never get that trap. Nagios service for that host and that trap, is configured ok, because when I execute

Code: Select all

/usr/lib/nagios/plugins/eventhandlers/submit_check_result $r TRAP 1 “Some Text “
from console, Nagios get that trap, and everything is OK . That test working with

Code: Select all

sudo -u snmptt 
also . Snmptt is member of nagios group. Snmptt log has no errors . According snmptt log, snmptt process the trap , and execute

Code: Select all

/usr/lib/nagios/plugins/eventhandlers/submit_check_result $r TRAP 1
and that is it . No traps in Nagios . I'm also changed #!/bin/sh with #!/bin/bash , because I find that solution in some forums, but with no luck at all .

Can anyone help me. Thanks in advance.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Nagios and snmp traps problem .

Post by jsmurphy »

well first things first, is your box even receiving the traps... check the /var/log/net-snmpd log files to confirm that your server is receiving the traps. Second check your /etc/snmp/snmptrapd.conf and make sure the path for the traphandle directive is set correctly. It would also be worth while enabling logging in the /etc/snmp/snmptt.ini file... this will allow you to see if the traps are actually being translated.

First step is going to be working out which step in the process is actually failing... once you can isolate that, we should be able to solve the actual problem.

Nagios and SNMP trap handling (without sugar coating it) is difficult and it sucks.
sun4o
Posts: 2
Joined: Sun Dec 02, 2012 9:27 am

Re: Nagios and snmp traps problem .

Post by sun4o »

As I said in my previous post snmptt receive the trap - the box receive the trap. And yes, the path in snmptrapd.conf is correct . By my opinion , snmptt translate the trap , and execute

Code: Select all

EXEC command:/usr/lib/nagios/plugins/eventhandlers/submit_check_result host.my.real.domain.bg TRAP 1 "Management Agent Event: Host VMDPS : SCellName-TimeDate EVA-1: 3-Dec-2012/    16:24:36 : EventCode 13021 : Description Remote Service Test Event"
Some paths

Code: Select all

ls /usr/lib/nagios/plugins/eventhandlers/submit_check_result
-rwxrwxrwx. 1 nagios nagios 1183 Nov 30 18:35 /usr/lib/nagios/plugins/eventhandlers/submit_check_result
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Nagios and snmp traps problem .

Post by jsmurphy »

Sorry your original post was a little bit hard to follow and I misunderstood, I'm on the same page now. Hmmm that is an interesting puzzle.

Is there any mention in the Nagios logs at all? Something that is similar to "Received check mytrap but can't find host/service"?
Locked