Need to notify if a device goes unreachable 6 times

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
yunushaikh
Posts: 176
Joined: Sat Jun 20, 2015 9:04 pm

Need to notify if a device goes unreachable 6 times

Post 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
dLans
Posts: 40
Joined: Tue May 27, 2014 1:54 am

Re: Need to notify if a device goes unreachable 6 times

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Need to notify if a device goes unreachable 6 times

Post 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.
Former Nagios Employee
Locked