Service Configuration Question

Paul L. Allen pla at softflare.com
Thu Mar 25 01:10:44 CET 2004


I had the feeling there was something I'd missed.  I've now figured out
what it was. 

Paul L. Allen writes: 

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

That's only going to work if you monitor only a single service on that
host.  You need a more complex scheme if you're monitoring multiple
services because more than one of them could change from an unknown
state to one of the other states. 

You could use a database, but then you'd have the overhead of opening a
database connection for each invocation (unless you wrote a daemon that
kept the connection open and took commands from a named pipe or Unix
socket). 

Hmmm, it's getting late so there's probably several flaws in this idea.
Create a directory for each host (otherwise with a lot of hosts and a lot
of services you're going to end up with so many files that directory
listings take forever.  In the directory are zero-length files called
OK, WARNING, CRITICAL and UNKNOWN.  When the submit_check_result script
gets called for service X on host Y it removes the file X in directory Y
(if it exists) then creates a hard link for file X in directory Y to
one of OK, WARNING or CRITICAL, depending on the status of the check.
The check_alive_if_unknown script then stats Y/UNKNOWN and if there's
more than one hard link it checks if the host is alive. 

In your situtation, you only need the UNKNOWN file and can remove
service files when the service goes from unknown to another state.
I mention the other files merely for completeness for those who want
to extend the idea. 

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