Page 1 of 1

Alert only if a metric is out-of-range for a period

Posted: Fri Oct 29, 2010 6:42 pm
by thomastk
Hi,
Is it possible to configure Nagios to alert only if a metric is out-of-range for a specified length of time only? For example, the memory usage check is done every 5 mins and the alert needs to be sent out only if that metric is stayed high for an extended period of time, say for an hour. The work-around could be to track the metric by the plugin but I wonder if there is anything simpler.

Thomas

Re: Alert only if a metric is out-of-range for a period

Posted: Tue Nov 02, 2010 9:41 am
by tonyyarusso
You can use the max_checks setting and math to accomplish this. One hour is 5 minutes times 12, so if you check every 5 minutes and require 12 failures before sending a notification that will do what you want. It will still show as a problem in the web interface while still a "soft" state though.

Re: Alert only if a metric is out-of-range for a period

Posted: Thu Nov 11, 2010 5:13 pm
by thomastk
Thanks for the suggestion. Using the option check_interval combined with max_check_attempts this could be implemented indirectly. The check can be fine-tuned by using retry_check_interval option if needed.