Service dependencies not working as I would think?

Andreas Ericsson ae at op5.se
Mon Feb 14 10:05:33 CET 2005


C. Bensend wrote:
>>The following could happen:
>>
>>- ssh is OK
>>- you kill ssh
>>- nagios chek pgsql (it thinks that ssh is OK, since no check occured
>>since last OK)
>>- nagios says pgsql is DOWN (because you killed ssh)
>>- after a while nagios check ssh
>>- nagios says ssh is DOWN
>>
>>Dependencies means that nagios will check last result of a service
>>before checking the dependent service. It does not means that nagios
>>will check service ssh every time it needs to check pgsql.
> 
> 
> Hi Leonardo,
> 
>    Looking at the docs, it appears that the dependency will look at
> the last HARD state of the depended-upon service.  By using the
> soft_state_dependencies option, it should notice that the ssh
> service (the depended-on service) is not in an OK state, and hopefully
> will not alert.  Not sure how I missed that bit of info, but it's been
> One Of Those Days(tm).
> 
>    So, I added 'soft_state_dependencies=1' to nagios.cfg, and restarted.
> Killing ssh seems to be producing the results I wanted - it logged the
> postgresql failure, and immediately started testing the ssh service, and
> ONLY the ssh service.  Yay!
> 
>    To me, it seems like soft_state_dependencies should default to on -
> why would you not want a failure in a depended-upon service to be
> ignored when checking a dependent service, even if it is in a SOFT
> failure?  Ethan?
> 

Because SOFT states are considered temporary network flukes. A probably 
more accurate way would be to implement some sort of 
dependency_freshness interval, so that the SSH gets checked once more 
(and re-scheduled appropriately) when check_pgsql is about to run if 
more than (timing_interval * dependency_freshness) seconds have passed 
since last logged HARD ok. If that checks fails to, then put check_pgsql 
in a dependent soft state down.

>    Anyhoo - thanks much, Leonardo.  That got me thinking in the right
> direction.  :)
> 
> Benny
> 
> 

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
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