Nagios xi 5.8.6 Service Dependency under same host.

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
indrajit
Posts: 1
Joined: Wed Aug 02, 2023 10:28 pm

Nagios xi 5.8.6 Service Dependency under same host.

Post by indrajit »

Hello everyone,

I'm currently using Nagios xi 5.8.6 and I've set up a host named "INDRA." Within this host, I've added two services: "service_A" and "service_B." My goal is to establish a service dependency where "service_B" relies on the status of "service_A."

However, I'm encountering an issue where the dependency doesn't appear to be functioning as intended. Even when "service_A" is in a CRITICAL state, "service_B" still shows an OK status.

Here is the configuration snippet I'm using for the service dependency:

I have even tried the option "forced immediate check for host and all servicec" but the service_B is still OK.

Code: Select all

define servicedependency {
    # config_name                    INDRA_DEPENDENCY
    dependent_host_name              INDRA
    dependent_service_description    service_B
    host_name                        INDRA
    service_description              service_A
    inherits_parent                  1
    execution_failure_criteria       w,u,c,p,
    notification_failure_criteria    w,u,c,p,
    dependency_period                24x7
}
I'd greatly appreciate any insights or suggestions on why this service dependency might not be functioning as expected. Thank you in advance for your assistance.
User avatar
eloyd
Cool Title Here
Posts: 2189
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY

Re: Nagios xi 5.8.6 Service Dependency under same host.

Post by eloyd »

Dependencies are backwards from what most people think. Instead of saying "run service X when service Y is in this state," you say "run service X when service Y is NOT in one of these states." Check out https://assets.nagios.com/downloads/nag ... ncies.html for more information, but I think you have your execution failure states set improperly for what you want.

Code: Select all

How Service Dependencies Are Tested

Before Nagios executes a service check or sends notifications out for a service, it will check to see if the service has any dependencies. If it doesn't have any dependencies, the check is executed or the notification is sent out as it normally would be. If the service does have one or more dependencies, Nagios Core will check each dependency entry as follows:

    Nagios gets the current status* of the service that is being depended upon.
    Nagios Core compares the current status of the service that is being depended upon against either the execution or notification failure options in the dependency definition (whichever one is relevant at the time).
    If the current status of the service that is being depended upon matches one of the failure options, the dependency is said to have failed and Nagios Core will break out of the dependency check loop.
    If the current state of the service that is being depended upon does not match any of the failure options for the dependency entry, the dependency is said to have passed and Nagios Core will go on and check the next dependency entry.

This cycle continues until either all dependencies for the service have been checked or until one dependency check fails. 
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!