JMX notifications->snmptrapd->snmptt->Nagios Configuation


I was looking to configure Nagios so that it can accept SNMP traps(JMX notification thru snmptrapd->snmptt) and send e-mail.
As per the doc’s i’ve got snmptrapd writing the nagios.cmd file.But configured Nagios seems to not react to the PROCESS_SERVICE_CHECK_RESULT entries in the command file.
The configuration files i’m using are as bellow.Do let me know if i’m missing something in the conf. or the way to make nagios execute nagios.cmd entries.
Nagios Version 1.3
1 PROCESS_SERVICE_CHECK_RESULT :winnt_host:TRAP:1:Trap received

Respective conf in nagios.cfg—

define service{
use generic-service
e template to use

    host_name                       winnt_host
    service_description             TRAP
    is_volatile                     0
    check_period                    24x7
    max_check_attempts              3
    normal_check_interval           5
    retry_check_interval            1
    active_checks_enabled           0
    passive_checks_enabled          1
    contact_groups                  nt-admins
    notification_interval           120
    notification_period             24x7
    notification_options            w,u,c,r
    check_command                   check-host-alive


dns_enable = 0
strip_domain = 0
net_snmp_perl_enable = 0
translate_value_oids = 0
translate_enterprise_oid_format = 1

traphandle default /usr/sbin/snmptt

thanks in advance,


PROCESS_SERVICE_CHECK_RESULT :winnt_host:TRAP:1:Trap received
Should be:
PROCESS_SERVICE_CHECK_RESULT ;winnt_host;TRAP;1;Trap received
Those are semicolons, not colons. So whatever script/check is writing that external command, is not writing it with the correct syntax.


thanx jakkedup for your reply.But the script writing nagios.cmd is /usr/lib/nagios/plugins/eventhandlers/submit_check_result,it’s writing it just as you said i.e." PROCESS_SERVICE_CHECK_RESULT;winnt_host;TRAP;1;TRAP RECEIVED;".
I just made a typing mistake in the query :frowning: .
The case happening here is that the configured nagios is not executing the entries in the nagios.cmd,though the respective conf in nagios.cfg is—

looking fwd for ur thoughts,


ls -la /usr/local/nagios/var is what on your machine?
Sounds like a permission problem.
grep groupname_from_above_output_on_directory_rw /etc/group
Also, the above grep will show if the proper people are members of the appropriate group.


ls -la /usr/local/nagios/var returns
drwxrws— 2 nagiosad nagiocmd 4096 Dec 26 17:58 rw

As matter of fact i’m able to issue external commands thru the nagios web console,so it shouldn’t be permission issue.
I guess the issue seems to be in the snmptt.conf where the OID specific handling is getting ignored,well i still need to dig arnd to be sure.


The rw directory is owned by group nagiocmd but is the apache and nagios user a member of group nagiocmd in /etc/group? I don’t see that output. Also, what user runs nagios? I have to assume you changed that to nagiosad for some reason.