Defining service dependency

Assaf Flatto nagios at flatto.net
Mon Jan 25 17:29:52 CET 2010


Asrai khn wrote:
> Hi list,
>
> I want to define service dependency, i have read the relevant nagios 
> docs but I am not getting how to define one. we are running nagios 
> 3.2.x (pre build binary on centos 5.4)
> Eg, I want to define service dependency for all services that been 
> checked with nrpe, ie if nrpe not running on remote host then nagios 
> shouldn't send notifications for these services instead just for nrpe.
>
> Few days back our monitoring host send lot of notifications coz of 
> nrpe wasn't running on remote hosts, in this case I want nagios only 
> alert for 'nrpe' not all the services that being checked with nrpe.
>
> 1. So first I have define a service to check nrpe on remote hosts.
>
> # Command def for checking nrpe on remote hosts.
> define command{
>     command_name    nrpe_service
>     command_line    $USER1$/check_nrpe -H $HOSTADDRESS$
>     }
>
>
> 2. define a service for each hostgroup.
>
> # service def.
> define service{
>         use                             check-interval-service
>         service_description      nrpe
>         check_command         nrpe_service
>         hostgroup_name          Sol-Servers
>             }
>
> So far so good, I have several hosts (linux, solaris, hp) all of them 
> have the following standard service definition for checking remote 
> hosts service via check_nrpe
>
> define service{
>         use                             local-service
>         host_name                   BB-2,NB-1
>         service_description       SCC Procs
>         check_command          check_nrpe!check_scc_procs
>     }
> define service{
>         use                             local-service
>         host_name                   BB-2
>         service_description       SCC Partition
>         check_command           nrpe_disk!check_disk4
>         }
>
> we have 5-10 nrpe check for each hosts which are scattered in 
> different hostgroups.
>
> Now how to define a dependency so that if 'nrpe' service fail on 
> remote hosts nagios shouldn't send alerts for services whom check via 
> nrpe.
>
> Any configuration example will be greatly appreciated.
>
> Due to binary version of nagios installed it will not possible for me 
> to go for any patching solution.

You got so far and stopped near the finish line !!
define servicedependency{
       host_name                   BB-2,NB-1
       service                         nrpe
       dependent_host          BB-2,NB-1
       dendent_service     SCC Partition
       execution_failure_criteria      u,c,p
       notification_failure_criteria   u,c,p
    }

this is of the top of my head - you will need to make sure the 
directives are according to the nagios definitions (I'm sure i got at 
least one wrong) , but that is the way to move on.

Have fun.
      


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list