Verion 2.0b4 how does cgi's nagios_check_command work?

John P. Rouillard rouilj at cs.umb.edu
Wed Oct 12 20:18:29 CEST 2005


In message <43467920.4070508 at op5.se>,
Andreas Ericsson writes:

>John P. Rouillard wrote:
>> In message <43465AB9.6020304 at op5.se>,
>> Andreas Ericsson writes:
>>>John P. Rouillard wrote:

>>>>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.
>Because otherwise you shouldn't have access to reading process 
>information about another users process.
>> 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.
>
>Good idea. Write the code for it and submit a patch.

Actually not so much a good idea. There is actully a creation
datestamp in the status.dat file I was going to use, but I decided to
run an experiment first. I have my status_update_interval set to 3
seconds.

I used check_fileage to warn me if the file's age was over 3 seconds
and ran it in a while loop. It failed often. The longest interval was
139 seconds between updates with a number of periods of 20-30 seconds.

My guesses are:

   nagios only writes the status file when it needs to.

   nagios was caught up on host checks and didn't write the status file.

I have 50 hosts and 100 checks now, but it will be growing a
lot. However looking at the status file for a nagos heartbeat isn't
reliable without some changes to nagios 2.0.

				-- 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