Defining service dependency

Asrai khn asraikhn at gmail.com
Tue Jan 26 06:33:43 CET 2010


On Mon, Jan 25, 2010 at 9:29 PM, Assaf Flatto <nagios at flatto.net> wrote:

> 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.
>
> Thanks Assaf,

I ended up with the following working version,

define servicedependency{
    dependent_host_name       Sol-1
    dependent_service_description    Root Partition,Var Partition,Data
Partition,Current Load,FTP-BB
    host_name           Sol-1
    service_description        nrpe
    execution_failure_criteria    w,u,c
    notification_failure_criteria    w,u,c
    }

Later I'll switch my dependency configuration to something simple by using
"Time-saving Tricks" --->
http://nagios.sourceforge.net/docs/3_0/objecttricks.html#same_host_dependency

Tell me one thing, is it ok to get ...

Checking service dependencies...
    Checked 10 service dependencies.

For the 5 dependent_service_description above?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20100126/bd6c1ff0/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
-------------- next part --------------
_______________________________________________
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