Page 1 of 1

Service Dependencies

Posted: Mon Jun 24, 2019 9:33 am
by parisa
Hi,
I have around 500 hosts, that they are checked as passive check (SNMP Trap), I have some services for any host. some of the services are related to each other, I configure service dependencies for the services on all of hosts. But the dependencies don't work.
For example, I have a host : "Dezful PC-AGG4" and have services " FCS_ERROR, LCAS_PLCR, LCAS_PLCT, LCAS_TLCR, LCAS_TLCT, AU_AIS" and any service uses from an event-handler and I have defined service dependencies for the host and the services as below:

Code: Select all

define servicedependency {
    # config_name                    Fiber_Alarms_Dezful PC-AGG4_1
    dependent_host_name              Dezful PC-AGG4
    dependent_service_description    FCS_ERROR,LCAS_PLCR,LCAS_PLCT,LCAS_TLCR,LCAS_TLCT
    host_name                        Dezful PC-AGG4
    service_description              AU_AIS
    inherits_parent                  1
    execution_failure_criteria       n
    notification_failure_criteria    w,u,c,
    dependency_period                24x7
}

define servicedependency {
    # config_name                    Fiber_Alarms_Dezful PC-AGG4_2
    dependent_host_name              Dezful PC-AGG4
    dependent_service_description    FCS_ERROR,LCAS_PLCR,LCAS_PLCT,LCAS_TLCR
    host_name                        Dezful PC-AGG4
    service_description              LCAS_TLCT
    inherits_parent                  1
    execution_failure_criteria       n
    notification_failure_criteria    w,u,c,
    dependency_period                24x7
}

define servicedependency {
    # config_name                    Fiber_Alarms_Venous-KR1L411032_2 _3
    dependent_host_name              Dezful PC-AGG4
    dependent_service_description    FCS_ERROR,LCAS_PLCR,LCAS_PLCT
    host_name                        Dezful PC-AGG4
    service_description              LCAS_TLCR
    inherits_parent                  1
    execution_failure_criteria       n
    notification_failure_criteria    w,u,c,
    dependency_period                24x7
}

define servicedependency {
    # config_name                    Fiber_Alarms_Dezful PC-AGG4_4
    dependent_host_name              Dezful PC-AGG4
    dependent_service_description    FCS_ERROR,LCAS_PLCT
    host_name                        Dezful PC-AGG4
    service_description              LCAS_PLCR
    inherits_parent                  1
    execution_failure_criteria       n
    notification_failure_criteria    w,u,c,
    dependency_period                24x7
}

define servicedependency {
    # config_name                    Fiber_Alarms_Dezful PC-AGG4_5
    dependent_host_name             Dezful PC-AGG4
    dependent_service_description    FCS_ERROR
    host_name                        Dezful PC-AGG4
    service_description              LCAS_PLCT
    inherits_parent                  1
    execution_failure_criteria       n
    notification_failure_criteria    w,u,c,
    dependency_period                24x7
}
but when two alarms LCAS_PLCR,LCAS_PLCT were generated for the host, two event-handlers were run.

would you please guide me about the problem.

Re: Service Dependencies

Posted: Mon Jun 24, 2019 3:53 pm
by benjaminsmith
Hi @Parisa,

In this example, the following dependency will make set LCAS_PLCT as a dependent service of LCAS_PLCR.

Code: Select all

define servicedependency {
    # config_name                    Fiber_Alarms_Dezful PC-AGG4_4
    dependent_host_name              Dezful PC-AGG4
    dependent_service_description    FCS_ERROR,LCAS_PLCT
    host_name                        Dezful PC-AGG4
    service_description              LCAS_PLCR
    inherits_parent                  1
    execution_failure_criteria       n
    notification_failure_criteria    w,u,c,
    dependency_period                24x7
}
However, the execution_failure_criteria is set to none. This directive is used to specify the criteria that determine when the dependent service should not be actively checked. So in this case, LCAS_PLCT should still be actively checked.

Go to Home > Incident Management > Notifications and upload the report for Dezful PC-AGG4 during this time period to verify which services notifications were sent on.

Thanks

Re: Service Dependencies

Posted: Tue Jun 25, 2019 12:45 am
by parisa
@benjaminsmith Thanks for your answer

I don't have any records in "Incident Management > Notifications", because I don't configure notification hosts,I don't need to notification right now, but
I wanted to monitor some services on the hosts as passive check, when a trap is received for a service that changes state of it, event-handler of the service is run.
I have different scripts for the event-handlers. I have defined dependencies because I wanted not to run the event-handlers for dependent services when I have alarm on main services.

Re: Service Dependencies

Posted: Tue Jun 25, 2019 2:31 pm
by benjaminsmith
Hi Parisa,

Service dependencies are used to restrict active checks and notifications for services, and passive checks are not restricted by service dependencies. So in this case with passive checks, service dependencies will not affect the execution of event handlers. I've done some research and short of using customs scripts, there's not a simple workaround.

The Nagios Core documentation contains a detailed explanation of the functionality of service dependencies.

Host and Service Dependencies

Let me know if you have any questions.