<br><br><div class="gmail_quote">On Mon, Jan 25, 2010 at 9:29 PM, Assaf Flatto <span dir="ltr"><<a href="mailto:nagios@flatto.net">nagios@flatto.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">Asrai khn wrote:<br>
> Hi list,<br>
><br>
> I want to define service dependency, i have read the relevant nagios<br>
> docs but I am not getting how to define one. we are running nagios<br>
> 3.2.x (pre build binary on centos 5.4)<br>
> Eg, I want to define service dependency for all services that been<br>
> checked with nrpe, ie if nrpe not running on remote host then nagios<br>
> shouldn't send notifications for these services instead just for nrpe.<br>
><br>
> Few days back our monitoring host send lot of notifications coz of<br>
> nrpe wasn't running on remote hosts, in this case I want nagios only<br>
> alert for 'nrpe' not all the services that being checked with nrpe.<br>
><br>
> 1. So first I have define a service to check nrpe on remote hosts.<br>
><br>
> # Command def for checking nrpe on remote hosts.<br>
> define command{<br>
>     command_name    nrpe_service<br>
>     command_line    $USER1$/check_nrpe -H $HOSTADDRESS$<br>
>     }<br>
><br>
><br>
> 2. define a service for each hostgroup.<br>
><br>
> # service def.<br>
> define service{<br>
>         use                             check-interval-service<br>
>         service_description      nrpe<br>
>         check_command         nrpe_service<br>
>         hostgroup_name          Sol-Servers<br>
>             }<br>
><br>
> So far so good, I have several hosts (linux, solaris, hp) all of them<br>
> have the following standard service definition for checking remote<br>
> hosts service via check_nrpe<br>
><br>
> define service{<br>
>         use                             local-service<br>
>         host_name                   BB-2,NB-1<br>
>         service_description       SCC Procs<br>
>         check_command          check_nrpe!check_scc_procs<br>
>     }<br>
> define service{<br>
>         use                             local-service<br>
>         host_name                   BB-2<br>
>         service_description       SCC Partition<br>
>         check_command           nrpe_disk!check_disk4<br>
>         }<br>
><br>
> we have 5-10 nrpe check for each hosts which are scattered in<br>
> different hostgroups.<br>
><br>
> Now how to define a dependency so that if 'nrpe' service fail on<br>
> remote hosts nagios shouldn't send alerts for services whom check via<br>
> nrpe.<br>
><br>
> Any configuration example will be greatly appreciated.<br>
><br>
> Due to binary version of nagios installed it will not possible for me<br>
> to go for any patching solution.<br>
<br>
</div></div>You got so far and stopped near the finish line !!<br>
define servicedependency{<br>
<div class="im">       host_name                   BB-2,NB-1<br>
</div>       service                         nrpe<br>
       dependent_host          BB-2,NB-1<br>
       dendent_service     SCC Partition<br>
       execution_failure_criteria      u,c,p<br>
       notification_failure_criteria   u,c,p<br>
    }<br>
<br>
this is of the top of my head - you will need to make sure the<br>
directives are according to the nagios definitions (I'm sure i got at<br>
least one wrong) , but that is the way to move on.<br>
<br></blockquote><div>Thanks Assaf,<br><br>I ended up with the following working version,<br><br>define servicedependency{<br>    dependent_host_name       Sol-1<br>    dependent_service_description    Root Partition,Var Partition,Data Partition,Current Load,FTP-BB<br>
    host_name           Sol-1    <br>    service_description        nrpe<br>    execution_failure_criteria    w,u,c<br>    notification_failure_criteria    w,u,c<br>    } <br><br>Later I'll switch my dependency configuration to something simple by using "Time-saving Tricks" ---> <a href="http://nagios.sourceforge.net/docs/3_0/objecttricks.html#same_host_dependency">http://nagios.sourceforge.net/docs/3_0/objecttricks.html#same_host_dependency</a><br>
<br>Tell me one thing, is it ok to get ...<br><br>Checking service dependencies...<br>    Checked 10 service dependencies.<br><br>For the 5 dependent_service_description above?<br><br>Thanks.<br><br><br></div></div>