Nagios behaviour when scheduling checks

Sean McAfee smcafee at collaborativefusion.com
Fri Dec 12 16:53:15 CET 2008


Mohr James wrote:
> Hi All!
>
> We are running Nagios 3.0.1 and have serveral services with a check
> interval of 5 Minutes and retry of 1 minute. The problem is that the
> checks have a timeout of 65 seconds. I looked through the documentation
> but couldn't find out how Nagios behaves in this case.
Simple answer: the clock doesn't start until the first check exits

Real answer:
Since retry_interval is only used on an non-OK return, Nagios must 
process the prior check before it can tell if it needs a retry.  

The documentation is from 2.x since 3.x is "coming soon", but look at 
http://nagios.sourceforge.net/docs/2_0/images/checktiming.png (taken 
from http://nagios.sourceforge.net/docs/2_0/checkscheduling.html). 

- The X3 service reaper event is the one that pulls the result of a check
- X4/E is just the next check and not necessarily the next "normal" check. 
- If X3 is OK, then X4 is calculated from normal_check_interval
- If X3 gets a non-OK,  it would evaluate $SERVICEATTEMPT$ and 
$MAXSERVICEATTEMPTS$ to determine $SERVICESTATETYPE$, which then 
dictates whether the daemon needs to reschedule using retry_interval vs. 
normal_check_interval (and whether you've transitioned, which would kick 
off notifies, etc...)

In your situation:
1. Check 1 kicks off at 12:00:00 & times out at 12:01:05.
2. Nagios sees that it needs to retry_interval because 
$MAXSERVICEATTEMPTS$ > $SERVICEATTEMPT$
3. Check 2 is scheduled for 12:02:05 & times out at 12:02:10
4. Nagios sees that $MAXSERVICEATTEMPTS$ = $SERVICEATTEMPT$ and 
transistions $SERVICESTATETYPE$ from SOFT to HARD


If you were to set max_check_attempts to 3, the only difference would be:
4. Nagios sees that it needs to retry_interval because 
$MAXSERVICEATTEMPTS$ > $SERVICEATTEMPT$
5. Check 3 is scheduled for 12:03:15 & times out at 12:04:20
6. Nagios sees that $MAXSERVICEATTEMPTS$ = $SERVICEATTEMPT$ and 
transistions $SERVICESTATETYPE$ from SOFT to HARD

-- 
Sean McAfee
System Engineer

Collaborative Fusion, Inc.
 smcafee at collaborativefusion.com
 412-422-3463 x 4025

5849 Forbes Avenue
Pittsburgh, PA 15217

****************************************************************
IMPORTANT: This message contains confidential information
and is intended only for the individual named. If the reader of
this message is not an intended recipient (or the individual
responsible for the delivery of this message to an intended
recipient), please be advised that any re-use, dissemination,
distribution or copying of this message is prohibited. Please
notify the sender immediately by e-mail if you have received
this e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The
sender therefore does not accept liability for any errors or
omissions in the contents of this message, which arise as a
result of e-mail transmission.
****************************************************************




IMPORTANT: This message contains confidential information and is intended only for the individual named. If the reader of this message is not an intended recipient (or the individual responsible for the delivery of this message to an intended recipient), please be advised that any re-use, dissemination, distribution or copying of this message is prohibited. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.



------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
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