NETS header NETS Homepage UCAR Homepage NCAR Homepage SCD Homepage NETS Homepage About NETS Work requests & support
  Browse NETS topics: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

check-nagios (Pete's notes)

I found the following when configuring the check_nagios item in the cgi.cfg file:
March 13, 2004
NAGIOS PROCESS CHECK COMMAND

First, let me say that nagios is a *great* and powerful framework for monitoring your network, servers, etc.

In setting up the command to verify that the nagios service itself is running, I ran into a syntax issue that varied from the example provided in the cgi.cfg file. Since nearly all the other examples provided have been accurate, I figured I'd share what I found.

The existing line in the cgi.cfg (loacted in /usr/local/nagios/etc if you followed the install convention) for nagios_check_command is:

nagios_check_command=/usr/local/nagios/libexec/check_nagios /usr/local/nagios/var/status.log 5 '/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg'
If you run this from the command line it will fail as the check_nagios command requires command line switches before each parameter. So I messed around with the command line directly and got it to work (*from the command line*) with:

/usr/local/nagios/libexec/check_nagios -F /usr/local/nagios/var/status.log -e 5 -C '/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg'
Much to my dismay, though, this still did not work from the cgi. So, I took a hint from the output of check_nagios -h and tried the following:

nagios_check_command=/usr/local/nagios/libexec/check_nagios -e 5 -F /usr/local/nagios/var/status.log -C /usr/local/nagios/bin/nagios
This worked. I'm not sure if it was the order of the parameter or simple matching only the first part of the output from the ps command. I suspect it is the latter.

Posted by wintermute at March 13, 2004 11:19 PM


Address comments or questions about this Web page to the Network Engineering & Telecommunications Section (NETS) at nets-www@ncar.ucar.edu. The NETS is part of the Computational & Information Systems Laboratory (CISL) of the National Center for Atmospheric Research (NCAR), which is sponsored by the National Science Foundation (NSF) and managed by the University Corporation for Atmospheric Research (UCAR). This website follows the UCAR General Privacy Policy and the NCAR/UCAR/UCP Terms of Use.