[Nagiosplug-help] check_nagios -C problem
Franz, Jay
Jay.Franz at ssa.gov
Tue Jun 26 19:41:23 CEST 2012
We are in the process of setting up fail over monitoring for our existing Nagios server and are experiencing some problems with the 'check_nagios' plug-in. Specifically, it does not appear to recognize our full path command string. Instead, we are only able to make it work by stripping down the command path to its basename (i.e., '/opt/iexpress/nagios/bin/nagios' versus 'nagios'). Our OS, Nagios core, and plug-in versions follow, as well as the process status output of our Nagios command and the execution results from the 'check_nagios' plug-in. Any advice would be appreciated. Thanks.
--------------------
OS:
# uname -sr
HP-UX B.11.23
Nagios Core:
# /opt/iexpress/nagios/bin/nagios -v /opt/iexpress/nagios/etc/nagios.cfg | egrep "Nagios Core"
Nagios Core 3.2.3
Plugin:
# /usr/local/nagios/libexec/check_nagios --version
check_nagios v1.4.15 (nagios-plugins 1.4.15)
--------------------
# ps -ef | egrep "[/]opt/iexpress/nagios/bin/nagios"
nagios 9817 1 0 Jun 22 ? 05:34 /opt/iexpress/nagios/bin/nagios -d /opt/iexpress/nagios/etc/nagios.cfg
# /usr/local/nagios/libexec/check_nagios -e 60 -F /opt/iexpress/nagios/var/nagios.log -C /opt/iexpress/nagios/bin/nagios
NAGIOS CRITICAL: Could not locate a running Nagios process!
# /usr/local/nagios/libexec/check_nagios -e 60 -F /opt/iexpress/nagios/var/nagios.log -C nagios
NAGIOS OK: 2 processes, status log updated 1822 seconds ago
While the second iteration works, more or less, it will never return a CRITICAL status because it always matches against itself. That is, the 'check_nagios' script shows up in the list of processes when it executes.
For example, if we stop the Nagios server, the 'check_nagios' script still returns an OK status
# /sbin/init.d/nagios stop
Stopping nagios:
done.
# ps -ef | egrep "[/]opt/iexpress/nagios/bin/nagios"
<NO OUTPUT>
# ps -ef | egrep "[n]agios"
<NO OUTPUT>
# /usr/local/nagios/libexec/check_nagios -e 60 -F /opt/iexpress/nagios/var/nagios.log -C nagios
NAGIOS OK: 1 process, status log updated 15 seconds ago
Even if we reduce the expire window to 1, we never get more than a WARNING.
# /usr/local/nagios/libexec/check_nagios -e 60 -F /opt/iexpress/nagios/var/nagios.log -C nagios
NAGIOS OK: 1 process, status log updated 268 seconds ago
# /usr/local/nagios/libexec/check_nagios -e 1 -F /opt/iexpress/nagios/var/nagios.log -C nagios
NAGIOS WARNING: 1 process, status log updated 272 seconds ago
More information about the Help
mailing list