How to manage service dependencies

WAS THIS PAGE HELPFUL? Leave Feedback

Overview

Service Dependencies are optional and allow you to suppress notifications and active checks of services based on the status of one or more other services.

  • A service can be dependent on one or more other services
  • A service can be dependent on services which are not associated with the same host
  • Service dependencies are not inherited (unless specifically configured)
  • Service dependencies can be used to cause service execution and service notifications to be suppressed under different circumstances (OK, WARNING, UNKNOWN, and/or CRITICAL states)

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 will check each dependency entry as follows:

  • Nagios gets the current status of the service that is being depended upon.
  • Nagios 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 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 will go on and check the next dependency entry.
Steps

Defining service dependencies
  1. Select Configuration > Services, select Service Dependencies from the navigation tree, and select New.
  2. In the Service Dependency Template screen, specify a Name for the template, and select a Master Service name from the drop-down box. This specifies the service being dependent upon.
    • Next, select the Execution Failure Criteria;
      Execution dependencies are used to restrict when active checks of a service can be performed. Passive checks are not restricted by execution dependencies. This criteria determines when the dependent service should not be executed. If the service that is being depended upon (e.g. ssh_disk_root) is in one of the failure states we specify, the dependent service will not be executed. Valid options are a combination of one or more of the following: Okay checked fail on an OK state, Warning checked fail on a WARNING state, Unknown checked fail on an UNKNOWN state, and Critical checked fail on a CRITICAL state. If you specify n (none) as an option, the execution dependency will never fail and checks of the dependent service will always be executed. Example: If you specify Okay, Critical, and Unknown for execution failure criteria, the dependent service will not be executed if the service that's being depended upon is in either an OK, a CRITICAL, or an UNKNOWN state.
    • Continue with selecting the Notification Failure Criteria;
      If all of the notification dependency tests for the service passed, Nagios will send notifications out for the service as it normally would. If even just one of the notification dependencies for a service fails, Nagios will temporarily repress notifications for that (dependent) service . This criteria determines when notifications for the dependent service should not be sent out. If the service that is being depended upon (e.g. ssh_disk_root) is in one of the failure states we specify, notifications for the dependent service will not be sent out to contacts. Valid options are a combination of one or more of the following: Okay checked fail on an OK state, Warning checked fail on a WARNING state, Unknown checked fail on an UNKNOWN state, and Critical checked fail on a CRITICAL state. If you specify n (none) as an option, the notification dependency will never fail and notifications for the dependent service will always be sent out. Example: If you specify Warning in this field, the notifications for the dependent service will not be sent out if the service that is being depended upon is in a WARNING state.
  3. Select Save.

    Figure: Service Dependency Template

Applying service dependencies through manage service

Service Dependencies can be applied through the Manage Service or the Manage Host Service dependencies screens.

  1. Select Configuration > Services, expand the Services navigation tree and select the dependent service, the Manage Service screen will be displayed.
  2. Select the Service Dependencies tab, and select the desired Dependency template, previously defined along with a Parent Host from the list displayed or select same host if the dependency is for services on the same host. Select Add Dependency.

    Figure: Service Dependencies
Apply hosts

After making any service changes you will need to use the Apply Hosts tab to indicate the Service properties action(s) and Host services action to be taken. Please read the Apply screen carefully as caution should be taken before any actions.

  1. Select the Apply Hosts tab. The Hosts drop-down box lists all hosts that have this service. The checked service properties actions (e.g. Apply dependencies) will be applied to the host-service on all of these hosts.
  2. Check Service properties action(s) to apply and check Host services action to apply. Double check your service changes, the set of hosts that are assigned this service, the service properties you have checked to apply, and how you want to modify the existing host-services.
  3. When you're ready, select Apply.

    Figure: Apply Hosts

Adding a service dependency through manage host service
  1. Select Configuration > Hosts, select the dependent Host by expanding the Hosts navigation tree, select a Host Group, select the dependent Host, and select a Service. The Manage Host Service screen will be displayed.
  2. Select the Service Dependencies tab and the desired Dependency template and then choose the Parent Host from the list. Click Add Dependency.

    Figure: Adding a service dependency

Labels

configuration configuration Delete
monarch monarch Delete
service service Delete
dependencies dependencies Delete
dependency dependency Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.