<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Indeed it is a nagios 3.x bug :(<br>
<br>
I did some debug on base/check.c file and found the bogus function:<br>
<br>
<small><small><tt>/* check for hosts that never returned from a
check... */<br>
void check_for_orphaned_hosts(void){<br>
        host *temp_host=NULL;<br>
        time_t current_time=0L;<br>
        time_t expected_time=0L;<br>
<br>
<br>
       
log_debug_info(DEBUGL_FUNCTIONS,0,"check_for_orphaned_hosts()\n");<br>
<br>
        /* get the current time */<br>
        time(&current_time);<br>
<br>
        /* check all hosts... */<br>
       
for(temp_host=host_list;temp_host!=NULL;temp_host=temp_host->next){<br>
<br>
                /* skip hosts that are not currently executing */<br>
                if(temp_host->is_executing==FALSE)<br>
                        continue;<br>
<br>
                /* determine the time at which the check results should
have come in (allow 10 minutes slack time) */<br>
               
expected_time=(time_t)(temp_host->next_check+temp_host->latency+host_check_timeout+check_reaper_interval+600);<br>
<br>
                /* this host was supposed to have executed a while ago,
but for some reason the results haven't come back in... */<br>
                if(expected_time<current_time){<br>
<br>
                        /* log a warning */<br>
                        logit(NSLOG_RUNTIME_WARNING,TRUE,"Warning: The
check of host '%s' looks like it was orphaned (results never came
back).  I'm scheduling an immediate check of the
host...\n",temp_host->name);<br>
                       
logit(NSLOG_RUNTIME_WARNING,TRUE,"----------------  %d <
%d\n",expected_time,current_time);<br>
                       
logit(NSLOG_RUNTIME_WARNING,TRUE,"----------------
next_check            %d\n",temp_host->next_check);<br>
                       
logit(NSLOG_RUNTIME_WARNING,TRUE,"----------------
latency               %g\n",temp_host->latency);<br>
                       
logit(NSLOG_RUNTIME_WARNING,TRUE,"----------------
host_check_timeout    %d\n",host_check_timeout);<br>
                       
logit(NSLOG_RUNTIME_WARNING,TRUE,"----------------
check_reaper_interval %d\n",check_reaper_interval);<br>
<br>
                        log_debug_info(DEBUGL_CHECKS,1,"Host '%s' was
orphaned, so we're scheduling an immediate
check...\n",temp_host->name);<br>
<br>
                        /* decrement the number of running host checks
*/<br>
                        if(currently_running_host_checks>0)<br>
                                currently_running_host_checks--;<br>
<br>
                        /* disable the executing flag */<br>
                        temp_host->is_executing=FALSE;<br>
<br>
                        /* schedule an immediate check of the host */<br>
                       
schedule_host_check(temp_host,current_time,CHECK_OPTION_ORPHAN_CHECK);<br>
                        }<br>
<br>
                }<br>
<br>
        return;<br>
        }</tt></small></small><br>
<br>
Some of the logit() calls are from my debug. When nagios checks for
orphaned host checks it compares the actual time with an expected time
for the result to appear. This expected time is a sum of the next
scheduled check, the latency, the host_check_timeout and
check_reaper_interval directives plus 10 minutes. The problem here is
that I setted up to don't have regularly scheduled host
checks by putting check_interval to 0. So this expected time is wrongly
computed because next_check time is 0.<br>
With this debug I get the following information:<br>
<br>
[1213718288] Warning: The check of host 'teste' looks like it was
orphaned (results never came back).  I'm scheduling an immediate check
of the host...<br>
[1213718288] ----------------  730 < 1213718288<br>
[1213718288] ---------------- next_check            0<br>
[1213718288] ---------------- latency               0.454<br>
[1213718288] ---------------- host_check_timeout    120<br>
[1213718288] ---------------- check_reaper_interval 10<br>
<br>
The 730 is the expected_time where the plugin should have terminated
and 1213718288 is the current time. Because next_check is always set to
0, this causes that nagios always thinks that this was a orphanated
check.<br>
For now I puted the <small><tt>if(expected_time<current_time)</tt></small>
condition to <small><tt>if(expected_time<current_time && </tt><tt>temp_host->next_check>0</tt><tt>)</tt></small>
to don't have nagios think it has an orphaned check when the next_check
is 0. But I don't think this is a very good solution since host checks
can be orphaned and nagios don't get them.<br>
<br>
Is there any possibility to correct this behavior on a next nagios
release?<br>
<br>
Thank you very much<br>
Best regrads,<br>
<br>
<div class="moz-signature">
<meta http-equiv="Content-Type" content="text/html; ">
<title>Emanuel Massano</title>
<p class="MsoNormal"><strong><span
 style="font-size: 10pt; font-family: "Lucida Sans"; color: maroon;"
 lang="PT">Emanuel Massano</span></strong></p>
<p><span style="font-size: 10pt; font-family: Garamond; color: maroon;"
 lang="PT">
FCCN<br>
Av. do Brasil, n.º 101<br>
1700-066 Lisboa<br>
Tel: +351 21 844 0100<br>
Fax: +351 21 847 2167<br>
E-Mail: <a href="mailto:emanuel.massano@fccn.pt">emanuel.massano@fccn.pt<br>
</a><a href="http://www.fccn.pt/" title="http://www.fccn.pt">www.fccn.pt</a></span></p>
<p></p>
<p><strong><span
 style="font-size: 10pt; font-family: Garamond; color: gray;" lang="PT">Aviso
de Confidencialidade</span></strong></p>
<p></p>
<p><span style="font-size: 10pt; font-family: Garamond; color: gray;"
 lang="PT">Esta mensagem é exclusivamente destinada ao seu
destinatário, podendo conter informação CONFIDENCIAL, cuja divulgação
está expressamente vedada nos termos da lei. Caso tenha recepcionado
indevidamente esta mensagem, solicitamos-lhe que nos comunique esse
mesmo facto por esta via ou para o telefone +351 218440100 devendo
apagar o seu conteúdo de imediato.<br>
<br>
This message is intended exclusively for its addressee. It may contain
CONFIDENTIAL information protected by law. If this message has been
received by error, please notify us via e-mail or by telephone +351
218440100 and delete it immediately</span></p>
</div>
<br>
</body>
</html>