[plug] nagios / services depending on local host
Lucas van Staden
lvs at dedmeet.com
Thu Jul 31 15:29:26 WST 2008
Hello.
I am new to the list.
Using linux from around 1999.
Preferred disto's: gentoo and linuxmint
Noticed this request from Adam in the archive, thus as I have missed the
original post, I have cut 'n paste the question from the web.
Sorry if this causes a new thread.
Hi Adam.
I think you need to create an event-handler, hooked to the host check
event, which will be triggered when the host state changes.
The event handler (which can be any kind of script, whatever you are
comfortable in writing) can then be used to either activate/deactivate
the service checks for the hosts, depending on what the status of the
event was.
You could choose to use a global event-handler, or special handlers for
each hosts.
See the following:
http://nagios.sourceforge.net/docs/3_0/eventhandlers.html
http://nagios.sourceforge.net/docs/3_0/hostchecks.html
You mention you use nagios 2.9, so you may have to hunt down the
corresponding docs, as the links given are for version 3, but the event
handlers may very well be the same.
I have not done this myself, but it would be the way I would handle this.
Hope this helps getting you on the right track.
Regards
Lucas
www.dedmeet.com
Original mail extracted from web archive:
Author: Adam Hewitt
Date: 2008-07-30 09:55 +800
To: plug
Subject: [plug] nagios / services depending on local host
Hi All,
I have spent hours reading the Nagios documentation and I am quite
confused as to how to go about fixing this problem:
I have a bunch of servers being monitored successfully, however if a
server goes down Nagios will continue to run checks against the
services on that server. Each of these checks then have to timeout and
the scheduling queue ends up going through the roof. Is there an easy
way for me to prevent this from happening, ie. if the host is
registered as being down then only check the host and cancel all
service checks on that host?
I think I can do this by setting up each service as dependent on the
host, but that's a *lot* of extra config for something that seems like
it should work out of the box.
oh, its Nagios 2.9 btw.
While I am here, I may as well ask if there are any performance
tweaking that people can recommend for nagios as well. One thing I
have noticed which is a bit weird is that services checks dont seem to
happen in parallel 99% of the time. I look at the scheduling queue and
it shows 10-20 checks scheduled to be run in teh same second, but a
`watch -n 1 "ps uax | grep ^nagios"` only shows one being executed at
a time. The max_concurrent_checks value is set to 0 (unlimited) which
I have confirmed by running nagios -s....so something seems to be
preventing them from running concurrently.
Thanks.
Adam.
More information about the plug
mailing list