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

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
thomastk
Posts: 2
Joined: Fri Oct 29, 2010 6:32 pm

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

Post 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
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

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

Post 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.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
thomastk
Posts: 2
Joined: Fri Oct 29, 2010 6:32 pm

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

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