Service dependent on host?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Service dependent on host?

Post by npolovenko »

@rkane, No you actually need to add this option to the nagios.cfg file and then restart the nagios process.
host_down_disable_service_checks=1
notice the services are sending alerts first and are alerting on Attempt 1/5 rather than 5/5?
That's because they are in a HARD state. Once a service gets into a hard state Nagios sends a notification anyway. 1/5, 2/5 , 3/5, ...applies to services in a SOFT state. So once the retry interval reaches SOFT 5/5 the check becomes HARD 1/5 and Nagios sends a notification. We just don't see soft states in your report.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
rkane
Posts: 114
Joined: Wed Aug 15, 2018 3:56 pm

Re: Service dependent on host?

Post by rkane »

Didn't realize the report was filtered for HARD only, new report attached. Here's where I am having an issue:

Code: Select all

1) Everything is fine
2) Service A goes soft down (1/5)
3) Host goes soft down (1/5)
4) Service B goes hard down (1/5)
5) Host still soft down (2/5)
6) Service A goes hard down (1/5)
7) Host still soft down (3/5) and (4/5)
8) Service C and Service D go hard down (1/5)
9) Host goes hard down (5/5)
***Why did Service A go soft down after failing check (1/5) but Services B,C,D went hard down after failing check (1/5)?
***Why did Service A go hard down and reset back to (1/5) after reporting soft down on (1/5) the previous check?

To me it should look like this:

1) Everything is fine
2) Service A goes soft down (1/5)
3) Host goes soft down (1/5)
4) Service B goes SOFT down (1/5)
5) Host still soft down (2/5)
6) Service A STAYS SOFT down (2/5)
7) Host still soft down (3/5) and (4/5)
8) Service C and Service D go SOFT down (1/5)
9) Host goes hard down (5/5)
You do not have the required permissions to view the files attached to this post.
jforcier

Re: Service dependent on host?

Post by jforcier »

Hard states occur for hosts and services in the following situations:

1. When a host or service check results in a non-UP or non-OK state and it has been (re)checked the number of times specified by the max_check_attempts option in the host or service definition. This is a hard error state.
2. When a host or service transitions from one hard error state to another error state (e.g. WARNING to CRITICAL).
3. When a service check results in a non-OK state and its corresponding host is either DOWN or UNREACHABLE.
4. When a host or service recovers from a hard error state. This is considered to be a hard recovery.
5. When a passive host check is received. Passive host checks are treated as HARD unless the passive_host_checks_are_soft option is enabled.

Looking at #3, Service A goes down soft because Host is still OKAY, Service B goes down hard because Host is DOWN.
User avatar
rkane
Posts: 114
Joined: Wed Aug 15, 2018 3:56 pm

Re: Service dependent on host?

Post by rkane »

Appreciate the details, learning more all the time. Here's the statements that get me:
jforcier wrote: Service B goes down hard because Host is DOWN.
***wouldn't Service B, being aware of the host DOWN, not check rather than go down HARD?
npolovenko wrote:host should be in a hard state 1 minute before its services
***Is this incorrect based on the above quote?
npolovenko wrote:If the host was still in the soft state, the "host_down_disable_service_checks" option would not work.
***If this is true I'll still have an issue with the Service(s) going down HARD while the Host is still down SOFT correct?
User avatar
rkane
Posts: 114
Joined: Wed Aug 15, 2018 3:56 pm

Re: Service dependent on host?

Post by rkane »

scottwilkerson wrote:By default all services do not notify if their own host is down. This is the default behavior, so there is nothing extra to setup
jforcier wrote:Service A goes down soft because Host is still OKAY, Service B goes down hard because Host is DOWN
npolovenko wrote:No you actually need to add this option to the nagios.cfg file and then restart the nagios process.
host_down_disable_service_checks=1
I'm sure you can see there's a lot of conflicting information in this thread. I've added the "host_down_disable_service_checks=1" to my config file and restarted the service. Looks like it doesn't really do anything due to this:
npolovenko wrote:If the host was still in the soft state, the "host_down_disable_service_checks" option would not work
Report from this morning attached, still doing the same thing. What would be the point of the above flag if it doesn't respect SOFT down states? Either way, sounds like y'all have either a bug or a design flaw here. IMHO there is no reason to disrespect my settings arbitrarily due to the Host state type. If I've got my Services set to check 5 times @ 1 minute intervals before going HARD down I expect them to check 5 times @ 1 minute intervals before going HARD down. Maybe make a flag that can be enabled if the current behavior is desired?
You do not have the required permissions to view the files attached to this post.
jforcier

Re: Service dependent on host?

Post by jforcier »

1) Everything is fine
2) Service A goes soft down (1/5)
3) Host goes soft down (1/5)
4) Service B goes hard down (1/5)
5) Host still soft down (2/5)
6) Service A goes hard down (1/5)
7) Host still soft down (3/5) and (4/5)
8) Service C and Service D go hard down (1/5)
9) Host goes hard down (5/5)
This is the expected behavior as per this doc. It is only checking the state, not the state type.
https://assets.nagios.com/downloads/nag ... types.html
1) Everything is fine
2) Service A goes soft down (1/5)
3) Host goes soft down (1/5)
4) Service B goes SOFT down (1/5)
5) Host still soft down (2/5)
6) Service A STAYS SOFT down (2/5)
7) Host still soft down (3/5) and (4/5)
8) Service C and Service D go SOFT down (1/5)
9) Host goes hard down (5/5)
I can see how this logic would be preferred, but it's a big change. We are submitting a feature request to have this logic as an option.
User avatar
rkane
Posts: 114
Joined: Wed Aug 15, 2018 3:56 pm

Re: Service dependent on host?

Post by rkane »

Appreciate it. In the meantime is there anything I can do, short of disabling the Services, to force them to not notify if their Host is down (hard or soft)?
jforcier wrote: I can see how this logic would be preferred, but it's a big change. We are submitting a feature request to have this logic as an option.
User avatar
rkane
Posts: 114
Joined: Wed Aug 15, 2018 3:56 pm

Re: Service dependent on host?

Post by rkane »

PS - was going to try to achieve this through a dependency but it appears I can't make a service dependent on a host. Makes some sense to me as I'm sure that could turn into an architectural nightmare having to create dependencies on service instances.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Service dependent on host?

Post by lmiltchev »

Most of the hosts should have a ping service. You could try setting up your services dependent on the ping service (on the host) for the time being.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
rkane
Posts: 114
Joined: Wed Aug 15, 2018 3:56 pm

Re: Service dependent on host?

Post by rkane »

Appreciate the suggestion, I actually got rid of the ping service as the host itself has a native 'ping' that it uses. :)
I'll re-enable that ping service for now.
lmiltchev wrote:Most of the hosts should have a ping service. You could try setting up your services dependent on the ping service (on the host) for the time being.
Locked