Page 1 of 1
Need to notify if a device goes unreachable 6 times
Posted: Thu Nov 24, 2016 12:59 am
by yunushaikh
Hello Experts,
Is there any options for getting an alert if the device is unreachable for 6 times in a month or 30 days.
Please suggest
Re: Need to notify if a device goes unreachable 6 times
Posted: Thu Nov 24, 2016 5:07 am
by dLans
Hi,
I'm sure someone will be able to tell you if this function exists in Nagios or not (I do not know for certain). If there is not such an option you might be able to use Powershell (or any language really) to accomplish this. Its a workaround, but with some if statements you can make a basic script:
If server cannot be reached (ping)
read file C:\server.txt
count number
if number is below 6, add one
else report error to nagios
You just need to figure out how to prevent it from going to "6" in 30 minutes if your check runs every 5 minutes.
Kind regards,
Dennis Lans
Re: Need to notify if a device goes unreachable 6 times
Posted: Mon Nov 28, 2016 2:02 pm
by rkennedy
Thanks @dLans!
Nagios can check as often or as least often as you want, and it will notify you based on how checks are aggregated on a failure. For example, if Nagios detects your host is down, then it will respect your max_check_attempts variable BEFORE sending a notification. The metrics for the '6 times in a month or 30 days' would need to be logic built by you, since Nagios is notifying based on active alerts occuring on your system.