Is there any plugin or facility in nagios which can do this?? for ex: the CPU load rises to 80% for 2seconds would not be a problem. I want to get an alert if it remains at 80%++ for at least 5mins. is it possible??
2 Answers
While a service is okay, Nagios checks the service every check_interval
minutes (well, technically interval_length
, but that's usually one minute). When a service check fails, Nagios will start checking the service every retry_interval
minutes and will only send an alert if the service remains in the failed state for max_check_attempts
checks. See the documentation for details on all of this.
With that in mind, you can either make retry_interval
large, or set max_check_attempts
large, or both to increase the time a service must be in a failed state before reporting an error.
So if you want an alert only after a service has failed for more than five minutes, you can set retry_interval
to 1 and max_check_attempts
to 5. Note that the defaults are (I think) retry_interval
= 1 and max_check_attempts
= 3.
-
If I want to get alert in one/two second(s) I mean real time notification, What should I do???– JerryAug 29, 2012 at 7:28
you can always script your own check. for instance you can have sar running on the cron and your custom nagios check control the last 30 minutes of samples from sar.