Page 1 of 1
Nagios to Nagios dependency
Posted: Thu May 31, 2012 5:34 pm
by nagioshughvf
I am want to setup Nagios to Nagios service dependency. I have Nagios-A server located internally and Nagios-B in the cloud to monitor Service-1. If both Nagios-A and Nagios-B detects Service-1 is critical, send alert notification and execute event handler. If only one Nagios server detects Service-1 is critical, don't send notification. I appreciate any suggestions or help in pointing me toward the right direction. Thanks.
Re: Nagios to Nagios dependency
Posted: Fri Jun 01, 2012 6:28 pm
by jsmurphy
This and similar questions get asked quite a lot and the answer has always been no, not unless you are willing to entertain building yourself a creative solution to the problem. Nagios was never designed to know what another Nagios installation is thinking or feeling. That said there are many ways you could skin this cat.
What I would do for this particular problem is write a custom check that queried the ndoutils SQL database on the other nagios host and determined the status of the service check there, I would make this the service dependency for the original service. Alternatively you could create a wrapper script for the service check that did the same thing (queried both the regular service check and the database), this would probably be better as it removes the requirement for a service-dependency but would probably require a little bit more coding prowess.
There are more ways you could go about doing this, but those seem like the best ways I can think of off the top of my head.
Re: Nagios to Nagios dependency
Posted: Mon Jun 04, 2012 3:48 pm
by nagioshughvf
I appreciate the feed back. Do you know if this option will work? Configure Nagios to support distributed monitoring and obtaining service check information from NRPE. Then configure service dependencies on the Central server.
Re: Nagios to Nagios dependency
Posted: Mon Jun 04, 2012 4:50 pm
by agriffin
That plan sounds good to me, except
nagioshughvf wrote:obtaining service check information from NRPE.
is very vague and might not work the way you mean. NRPE is only for sending check results to a Nagios server. So you could have a plugin that checks the statuses of services on one server and send it to another server with NRPE, but NRPE won't actually do the hard work for you. You'll have to do something like what jsmurphy suggested, such as querying an ndoutils database.