Nagios to Nagios dependency

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
nagioshughvf
Posts: 3
Joined: Tue Apr 24, 2012 6:15 pm

Nagios to Nagios dependency

Post 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.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Nagios to Nagios dependency

Post 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.
nagioshughvf
Posts: 3
Joined: Tue Apr 24, 2012 6:15 pm

Re: Nagios to Nagios dependency

Post 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.
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Nagios to Nagios dependency

Post 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.
Locked