check_command instant feedback

Marc Powell marc at ena.com
Mon Apr 6 19:45:53 CEST 2009


On Apr 6, 2009, at 11:43 AM, Matt Nelson wrote:

> Hello, I'd like to be able to run a check_command from the command  
> line and have it return feedback immediately (versus a forced-check  
> from the webui).  Is this possible?

Given time and a sufficiently motivated programmer, anything is  
possible. Reasonably so? Probably not.

> The reason for this is that I'm trying to throw together a simple  
> web interface and when the user clicks 'recheck' a window will pop  
> up with the results of that particular service's check_command.
>
> I thought about parsing the commands.cfg file for the command and  
> then looping through the $ARGX$ fields and plugging in the correct  
> values - but this seems extremely complicated (what with dealing  
> with commands with variable-length fields, user macros, etc.).

Yup, this is about what you'd need to do. I've never seen anything  
that would spit out the command that nagios would execute, fully  
expanded. I could see that being interesting in the host/service info  
though. If someone were to code that addition to the CGI's (if it's  
possible), that would get you about 1/2 way there.

Another point to consider is that your checks would be run as the  
httpd user presumably, which may or may not be able to run all the  
commands that nagios can. For example, check_by_ssh checks would be  
problematic...

--
Marc


------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
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