Nagios not able to access nagios.cmd

Marc Powell marc at ena.com
Mon Oct 8 16:37:47 CEST 2007


Please always post on list. Even though I post a lot, I'm not dedicated
to nagios support.

> -----Original Message-----
> From: pankaj.dhali at wipro.com [mailto:pankaj.dhali at wipro.com]
> Sent: Monday, October 08, 2007 8:45 AM
> To: Marc Powell
> Subject: Nagios not able to access nagios.cmd
> 
> 
> Hi Marc,
>             Thanks for your correction. But still Nagios doesn't seem
to
> access the command file i.e., /usr/local/nagios/var/rw/nagios.cmd. I
have
> set this path correctly for nagios.cmd. I am using the attached script
and
> running it mannually to submit Passive Service Check to Nagios through
the
> following command:
> 
> --------------------------------------------------
> 
> [root at Symbol eventhandlers]# pwd
> 
> /usr/local/nagios/libexec/eventhandlers
> 
> [root at Symbol eventhandlers]# python snmptraphandling.py 10.207.40.203
> CRITICAL 12
> 
> 2
> 
> [root at Symbol eventhandlers]#

While it's probably not important in this case, you shouldn't run tests
associated with nagios as the root user. Nagios doesn't run as root and
neither do most of its support programs so you're likely to see
different results.

As for the script, I've never programmed in python but it appears to end
up submitting an external command something like --

[timestamp]
PROCESS_SERVICE_CHECK_RESULT;10.207.40.203;snmp_trap_handling_critical;2
;"12"
 
Nagios will ignore external commands for hosts and services that it
doesn't know about. It will log them though and you should see them in
nagios.log. Based on your usage of this script and using
http://www.nagios.org/developerinfo/externalcommands/commandinfo.php?com
mand_id=114 and
http://nagios.sourceforge.net/docs/2_0/passivechecks.html as guides, you
_must_ have the following host and service definitions. They were not
included in the files you sent to me --

- A host{} definition with a host_name of '10.207.40.203'
- a service{} definition with a host_name of '10.207.40.203' and
service_description of 'snmp_trap_handling_critical'

After creating the service for localhost named
snmp_trap_handling_critical, you probably want to run it as

$ python snmptraphandling.py localhost CRITICAL 12

> ---------------------------------------------
> 
> I have attached the services.cfg and commends.cfg
> 
> I am not understanding why Nagios always shows :
> 
> status -> CRITICAL
> 
> and
> 
> Status Information -> Return code of 127 is out of bounds - plugin may
be
> missing.

This implies that you have active checks enabled for the service and
specified a check_command that references a plugin that doesn't exist in
the location you've specified. Does
/usr/local/nagios/libexec/passive_check_missing.sh exist? Do you have a
command definition for check_dummy that points to a real plugin? Based
on your sample service definition, nagios will run the
passive_check_missing script every 10 minutes, regardless of whether
it's received results or not. is_volatile means that it will notify you
every 10 minutes when it runs passive_check_missing regardless of
whether you receive passive results or not. You probably want to set
normal_check_interval to 0 and let the freshness checking run it as
needed (http://nagios.sourceforge.net/docs/2_0/freshness.html - Working
With Passive-Only Checks)

--
Marc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list