Service keeps OK status before retrys checks

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
gilbertogm
Posts: 4
Joined: Fri Apr 04, 2014 7:16 am

Service keeps OK status before retrys checks

Post by gilbertogm »

Hello there guys,

I've got a situation which is:

I'm monitoring a service every five minutes and the status information is sent to the DB every five minutes consequently.

The thing is: When service goes to critical, my application treats this as the service is out.

Basically what i wanted is that before the service goes to status CRITICAL, it holds on the OK status for a while and do the rechecks before goes to a CRITICAL state.

Lets say if Nagios detects that the service is CRITICAL it doesn't change the status, retrys 5 times in 5 minutes and if the service stills on CRITICAL state, then goes to CRITICAL.

Does anyone have an idea?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Service keeps OK status before retrys checks

Post by abrist »

Well, if the check fails, it will go into a critical state. You can delay notifications and other actions with a retry value, and until that retry value is reached, the critical state is a soft type. This is how the logic works, and you would have to alter the core source to change it. You could wrap your check in another script that handles the logic before the check is reported to nagios. This would allow you to detect a failed state, save the info to a local file while returning ok. On the next check you would check the file for the state of the last check, and if it failed, and is still failing, then report a critical. This will require you to write a custom wrapper script for the check . . .
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.
gilbertogm
Posts: 4
Joined: Fri Apr 04, 2014 7:16 am

Re: Service keeps OK status before retrys checks

Post by gilbertogm »

Thats how I have done. I wrote a custom script. Thanks for the help.
Locked