...

Open source softwares - Nagios

Back to Course

Lesson Description


Lession - #1543 Nagios Hosts and Services


Service and host dependences are an advanced feature of Nagios that allow you to control the geste  of hosts and services based on the status of one or further other hosts or services. I will explain how dependences work, along with the differences between host and service dependences .    #### Service Dependences Overview Tip In numerous cases, a parent/ child service relationship is a important simpler way of expressing service dependences . Service parent relationships are defined with the parents directive in service definitions.  There are a many effects you should know about service dependences * A service can be dependent on one or further other services * A service can be dependent on services which aren't associated with the same host * Service dependences aren't inherited( unless specifically configured to>
* Service dependences can be used to cause service check prosecution and service notifications to be suppressed under different circumstances( OK, WARNING, UNKNOWN, and or CRITICAL states>
* Service dependences might only be valid during specific timeperiods * Defining Service Dependences * First, the basics. You produce service dependences by adding service dependency definitions in your object config file( s>
. In each description you specify the dependent service, the service you're depending on, and the criteria( if any>
that beget the execution and notification dependences to fail( these are described later>
.  You can create several dependences for a given service, but you must add a separate service dependency description for each dependency you produce.    #### Example Service Dependences * The image below shows an illustration logical layout of service notification and execution dependences . Different services are dependent on other services for notifications and check execution.    #### Example *


      #### Host Dependencies * As you'd probably expect, host dependences work in a similiar fashion to service dependences . The difference is that they are for hosts, not services.  Tip Don't confuse host dependences with parent/ child host relationships. You should be using parent/ child host relationships( defined with the parents directive in host delineations>
for most cases, rather than host dependences . A description of how parent/ child host connections work can be set up in the documentation on network reachability.  Then are the basics about host dependences    ```plaintext define servicedependency { host_name Host A service_description Service A dependent_host_name Host B dependent_service_description Service D execution_failure_criteria u notification_failure_criteria n } define servicedependency { host_name Host A service_description Service B dependent_host_name Host B dependent_service_description Service E execution_failure_criteria w,u notification_failure_criteria c } define servicedependency { host_name Host B service_description Service C dependent_host_name Host B dependent_service_description Service E execution_failure_criteria n notification_failure_criteria w,u,c } ``` * A host can be dependent on one or further other host * Host Dependences aren't inherited( unless specifically configured to>
* Host dependences can be used to cause host check execution and host announcements to be suppressed under different circumstances( UP, DOWN, and/ or UNREACHABLE states>
* Host dependences might only be valid during specific timeperiods #### Example *

    ```plaintext


``` ```plaintext define hostdependency { host_name Host A dependent_host_name Host C notification_failure_criteria d } define hostdependency { host_name Host B dependent_host_name Host C notification_failure_criteria d,u } ```