External Commands Logic.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
samuel
Posts: 55
Joined: Wed Jan 16, 2013 4:44 pm

Re: External Commands Logic.

Post by samuel »

My intention is to make it so that if that ping service is down and the host up then enable notifications. But if the host goes down as well then disable notifications. I need the host to overule the service. which it does if the service goes down first. the problem is when nagios actively checks it the host might be checked first and then the service.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: External Commands Logic.

Post by abrist »

You may have to rework the logic as there is no good way in nagios to force checks to be scheduled before others. Is the service check an ICMP ping check to the host behind the router?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
samuel
Posts: 55
Joined: Wed Jan 16, 2013 4:44 pm

Re: External Commands Logic.

Post by samuel »

In the real situation it will be, but currently I am testing this specific occurrence, where the host and the service is down with a host and a ping service that pings that host. It makes it easier to test when they are both down.
There are four different situations that can happen.
nagios1 goes down then router1 stays up.
nagios1 goes down then router1 goes down.
router1 goes down but naigos1 is up.
router1 goes down then nagios1 goes down.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: External Commands Logic.

Post by scottwilkerson »

samuel wrote: I need the host to overule the service. which it does if the service goes down first.
This is all usually take care of automatically if your max_check_attempts * retry_interval is as long or longer than the regular check interval of the hosts...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
samuel
Posts: 55
Joined: Wed Jan 16, 2013 4:44 pm

Re: External Commands Logic.

Post by samuel »

Currently the max check attempts and retry interval are set to one.
That is just because of the test.
Usually max check is 5.
retry is 1.

So your fix to it would be to make either the max check attempts for the host longer or the max check attempts for the service shorter?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: External Commands Logic.

Post by sreinhardt »

I think you want to invert that logic. The host checks should be in shorter interval than service retry*attempts, to allow for the host to stop alerts on a service.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
samuel
Posts: 55
Joined: Wed Jan 16, 2013 4:44 pm

Re: External Commands Logic.

Post by samuel »

It would stop the alerts but if the service goes into a critical state after the host goes down it would enable alerts.
samuel
Posts: 55
Joined: Wed Jan 16, 2013 4:44 pm

Re: External Commands Logic.

Post by samuel »

Would this work
service:
check interval: 5
retry interval: 1
max checks: 3

host:
check interval: 5
retry interval: 1
max checks: 5

It gives the host two more minutes before going into hard state.
Should I make it so that its at least five or seven minutes more before going into hard state?
To make sure that the majority of the time it is going to go hard state last.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: External Commands Logic.

Post by slansing »

If you would rather have the service's go into a hard state before the host then yes the above would work in that scenario, it's really down to how you want to be alerted, and when.
samuel
Posts: 55
Joined: Wed Jan 16, 2013 4:44 pm

Re: External Commands Logic.

Post by samuel »

The aim is to have as few duplicate alerts as possible.
If the router goes down then I don't want to be alerted on all the unreachable hosts on the other side.
With this logic I can make that situation happen.
While making sure that if one nagios server goes down it will be picked up by the other.
Locked