Verion 2.0b4 how does cgi's nagios_check_command work?

John P. Rouillard rouilj at cs.umb.edu
Fri Oct 7 16:30:26 CEST 2005


In message <43467920.4070508 at op5.se>,
Andreas Ericsson writes:
>John P. Rouillard wrote:
>> Andreas Ericsson writes:
>>>John P. Rouillard wrote:
>>>>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.
>
>Because otherwise you shouldn't have access to reading process 
>information about another users process.

But an external command called by the cgi that is suid to the nagios
user would allow monitoring of the nagios process w/o root privs.  But
I understand the point.

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

I'll see what I can do. Hopefully somebody with better C skills will
beat me to it.

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