Passive check on an active check's response?

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
pbrunnen
Posts: 2
Joined: Thu Mar 01, 2012 12:15 am

Passive check on an active check's response?

Post by pbrunnen »

Hello all,
This may seem silly... but I have a question in regard to having a passive check on an active check's response.

We have an active service check on our DNS servers to make sure that the bind daemon is running... and as part of this, the perfdata is filled with helpful statistical information on successfull requests, referrals, nxdomains, etc. This data is very useful and we graph it with nagiosgrapher. Now, we had an admin mistake cause failure responses... and I caught this by taking a peek at the graph. This was great (crisis averted) but my thought was that I should be able to check those statistics and create an alarm based on them... I didn't want to create extra load on the DNS servers by adding more active checks which comb through the same data as we already collected. Hence my thought about creating a passive check on the perfdata already in nagios.

I searched around and was not successful in finding anything already written... and I was trying to avoid scraping the status.dat file. Does anyone have any suggestions?

Much appreciated...
- Cheers, Peter.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Passive check on an active check's response?

Post by abrist »

What you most likely want to do is create a custom event handler script. See the following document for the general "how-to", you can always ask more questions once you understand the basics of event handlers:
http://nagios.sourceforge.net/docs/3_0/ ... dlers.html
Even though the following document is for Nagios XI, it incudes some starter scripts that might help you get coding:
http://assets.nagios.com/downloads/nagi ... ndlers.pdf
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
pbrunnen
Posts: 2
Joined: Thu Mar 01, 2012 12:15 am

Re: Passive check on an active check's response?

Post by pbrunnen »

Hi abrist,
I took a look at the core documentation you linked me to. I don't quite understand how this would work... Per the documentation: "Event handlers are executed when a service or host: * Is in a SOFT problem state; * Initially goes into a HARD problem state; * Initially recovers from a SOFT or HARD problem state". Based on this I would not expect that the event handler would be able to track statistics while the service is not in an error state.

For instance, if the error rate of the bind daemon increases but the daemon is still running, currently nagios does not see a problem because while the check reports perfdata the error states are only reported if the daemon is not running. So the error response count for the bind daemon could be increasing but because the daemon is alive it would (based on the reading above) never trigger the event handler. Or is there a way to make an event handler trigger on every update?

Thanks! -Cheers, Peter.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Passive check on an active check's response?

Post by sreinhardt »

I agree, Peter, I don't believe that event handlers are quite what you are looking for, but a way to check the rrd's created via nagios grapher. Instead, I think you want to look at one of the two plugins below for checking the data that is contained in your rrds.

http://exchange.nagios.org/directory/Pl ... pl/details

http://exchange.nagios.org/directory/Pl ... rd/details
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked