Verion 2.0b4 how does cgi's nagios_check_command work?
John P. Rouillard
rouilj at cs.umb.edu
Fri Oct 7 14:33:36 CEST 2005
In message <43465AB9.6020304 at op5.se>,
Andreas Ericsson writes:
>John P. Rouillard wrote:
>> Hi all:
>>
>> I have groveled through the cgi files in nagios 2.0b4 and I can't find
>> any instance of the nagios_check_command actually being executed. Am I
>> just missing it somewhere?
>>
>
>The nagios_check_command has been incorporated into the cgi's. That's
>why the status.dat file has the nagios entry on top.
So the CGI's report nagios is down if and only if the status.date file
is missing? That matches what I see when I shut down nagios properly.
If I shut down nagios I see the "Error: Could not read host and
service status information!" page in the web interface.
>> cgiutils.c load the variable from the config file
>> extinfo.c checks to see if the variable is empty and produces a nice
>> little warning if it is.
>>
>> but nothing seems to actually execute the command. The reason I ask is
>> that nagios was down and the cgi's all happily reported that it was
>> up. Could this be because the host and service status files were
>> available since the machine crashed?
>Yes, that's almost certainly it. There is no really good way of
>detecting that nagios is actually running unless you're logged in as
>root.
Hmm, I am not sure I follow why you need to be logged in as root. Why
not stat the status.log file and check to see if its (mtime) timestamp
is less than the setting of:
status_update_interval*2
if aggregate_status_updates is enabled? One could also allow a setting
"freshness_threshold" in cgi.cfg that is the number of seconds/minutes
old the status.dat file is allowed to be if aggregate_status_updates
isn't set.
> Noone (sane) runs their webserver as root.
True enough.
-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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