check_ping -- how to get -i <interval> option ?

Andreas Ericsson ae at op5.se
Tue Feb 1 21:22:43 CET 2005


Joubin Moshrefzadeh wrote:
> I occasionally get a host down alert, that is fixed on the next check
> cycle. In my opinion thats sort of a false positive, and I want to
> give the host test script a longer time-span before it decides a host
> is down/unreachable.
> 
> Any way to incorporate the -i <interval> option of ping into the
> check_ping script?
> 

You can use the check_icmp program and specify -i directly. Set it as 
high as you like. If it receives a response before it times out it will 
send another one, usually making the REAL interval shorter, while 
allowing the possibility of a long one. Just make sure you set a high 
enough timeout value. You can check that by adding -v twice on the 
command line. If your -t value is too low it will tell you "timeout must 
be at least x". max_completion_time is calculated as such
packets * targets * (critical_rta + packet_interval + target_interval) + 
critical_rta (the last critical_rta is just to catch straggler).

> My workaround right now is to use "check_ping -t 10 -w 3000.0,80% -c
> 5000.0,100% -p 1", and to specify "max_check_attempts  30" so that i
> know that a host is definitely down for at least 5 minutes before I
> get a HOST DOWN alert.
> 

That's not very smart, considering hostchecks are done in serial and 
without any kind of threading, so while one of your hosts are being 
checked this way nothing else is.

> I know mon has a feature where you can specify the number of failures
> for a check before it sends out a notification. Anything similar in
> Nagios?
> 

That would be the max_check_attempts variable. Perhaps you should read 
up on hard/soft states.

I believe you could also accomplish the same thing with escalations, 
although I'm not sure since I don't use them myself.

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


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
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