Service Configuration Question

Paul L. Allen pla at softflare.com
Wed Mar 24 19:36:09 CET 2004


Michael Eck writes: 

> I'd like to configure Nagios to only perform a host check on state
> UNKNOWN for this particular service.  It doesn't seem like this is 
> possible though.

With software, anything is possible.  The only questions are how much
effort is involved in modifying it, how badly the modifications affect
performance and are the modifications so klugey that you have to hold
your nose while you make them.  Obviously you could get what you want by
modifying the source.  However, it might be possible to fiddle things
without having to hack the source around. 

I've not checked this idea too closely, so you may have to tweak it
somewhat or there may be an unsurmountable obstacle I've overlooked.
Set nagios to obsess, just as though it were going to be used to also
submit passive checks to another Nagios host.  In misccommands.cfg, define
a submit_check_result command, just as if you were actually going to
submit passive checks to another machine, but the shell/perl script it
calls doesn't actually call NSCA, it does something sneaky.  Define
a special check_host_if_unknown command in checkcommands.cfg which
calls another shell/perl script.  In hosts.cfg, change the check_command
to check_host_if_unknown for the appropriate hosts. 

The trick is that your submit_check_result shell/perl script sets a
flag of some sort - I'd use touch to create a file with the same name
as the host if the service state is unknown and delete it otherwise (if
I understood what you're trying to do correctly).  Your
check_host_if_unknown shell/perl script checks for the presence or
absence of the file corresponding to the host and either does a ping
test or returns an OK as appropriate. 

Fairly simple to do and no modification of source involved.  Probably
won't seriously impact performance.  Up to you whether you need nose plugs
or not when you implement it. 

-- 
Paul Allen
Softflare Support 




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
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