<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 5.50.4611.1300" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002>Andrew, I'm puzzling over your approach.  It could 
well be that your requirements have dictated this approach, but I thought I'd 
voice my thoughts, just in case.</SPAN></FONT></DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002></SPAN></FONT> </DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002>It appears that you're trying to do this status 
check:</SPAN></FONT></DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002></SPAN></FONT> </DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002>Nagios_host -> hostA -> 
httpd_on_hostB</SPAN></FONT></DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002></SPAN></FONT> </DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002>If you have a firewall which is causing you to use this 
approach, I'd understand.  But even using Fredrik Wänglund's approach, I 
still have to wonder what value $HOSTADDRESS$ will have.  If it ends up 
having the value of the IP address of the host which is executing it (ie, 
hostA), that's one approach.  If your intent was to have it poke at hostB, 
I'm not sure where it will acquire that IP address value.</SPAN></FONT></DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002></SPAN></FONT> </DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002>If all you're trying to do is check the status of the 
webserver on hostA, and there are no firewalls to contend with, I would suggest 
that you not bother with NRPE (for this check).  You're making it 
unnecessarily complicated.</SPAN></FONT></DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002></SPAN></FONT> </DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002>Instead, do something like this (from my configs, so I 
apologize for the terseness).  From services.cfg:</SPAN></FONT></DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002></SPAN></FONT> </DIV>
<DIV><FONT face="Comic Sans MS" size=2><SPAN class=341470416-03102002><FONT 
color=#000080><FONT face="Courier New">define 
service{<BR>        
name                            
http<BR>        
use                             
icmp<BR>        
service_description             
HTTP<BR>        
notification_options            
w,u,c,r<BR>        
check_command                   
check_http!80<BR>        
register                        
0<BR>        
}</FONT><BR></FONT></SPAN></FONT></DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002>Also from services.cfg:</SPAN></FONT></DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002></SPAN></FONT> </DIV>
<DIV><FONT face="Courier New" color=#000080 size=2><SPAN 
class=341470416-03102002>define 
service{<BR>        
host_name                       host1<BR>        
use                             
http<BR>        
contact_groups                  
linux-admins<BR>        }</SPAN></FONT></DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002></SPAN></FONT> </DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002>And from checkcommands.cfg:</SPAN></FONT></DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002></SPAN></FONT> </DIV>
<DIV><FONT face="Comic Sans MS" size=2><SPAN class=341470416-03102002><FONT 
color=#000080><FONT face="Courier New">define 
command{<BR>        
command_name    
check_http<BR>        
command_line    $USER1$/check_http -H $HOSTADDRESS$ -p 
$ARG1$<BR>        
}</FONT><BR></FONT></SPAN></FONT></DIV>
<DIV><FONT face="Comic Sans MS" size=2><SPAN class=341470416-03102002><FONT 
color=#000080>With this approach, my Nagios host will attempt a direct 
connection to port 80 on host1.  (It does more than that; do a "check_http 
--help" for details.)</FONT></SPAN></FONT></DIV>
<DIV><FONT face="Comic Sans MS" size=2><SPAN class=341470416-03102002><FONT 
color=#000080> </DIV></FONT></SPAN></FONT>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002>Hope this helps.</SPAN></FONT></DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002></SPAN></FONT> </DIV>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002>jc</DIV></SPAN></FONT>
<DIV><FONT face="Comic Sans MS" color=#000080 size=2><SPAN 
class=341470416-03102002> </DIV>
<DIV><BR></DIV></SPAN></FONT>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000080 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Kaplan, Andrew H. 
  [mailto:AHKAPLAN@PARTNERS.ORG]<BR><B>Sent:</B> Thursday, October 03, 2002 8:35 
  AM<BR><B>To:</B> 'Kenneth.ray'<BR><B>Cc:</B> 
  'nagios-users@lists.sourceforge.net'<BR><B>Subject:</B> RE: [Nagios-users] Re: 
  Retrun code of 99 is out of bounds<BR><BR></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=593213713-03102002>Hi 
  Ken,</SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=593213713-03102002></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=593213713-03102002>I 
  did a check of the command and the feedback I got indicated the check_http 
  command was not defined. I went to the remote host's nrpe.cfg file and I 
  checked the syntax </SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN class=593213713-03102002>of 
  the check_http command. Here's what it reads:</SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=593213713-03102002></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=593213713-03102002>    
  command[check_http]=/usr/local/nagios/libexec/$USER1$/check_http -H 
  $HOSTADDRESS$</SPAN></FONT></DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=593213713-03102002></SPAN></FONT> </DIV>
  <DIV><FONT face=Arial color=#0000ff size=2><SPAN 
  class=593213713-03102002>Should the above line have the $USER1$ setting 
  changed to the actual user running the daemon, and similarly should 
  $HOSTADDRESS$ be the actual address of the remote host?</SPAN></FONT></DIV>
  <BLOCKQUOTE>
    <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
    size=2>-----Original Message-----<BR><B>From:</B> Kenneth.ray 
    [mailto:kenneth.ray@travelersla.com]<BR><B>Sent:</B> Thursday, October 03, 
    2002 8:33 AM<BR><B>To:</B> 
    nagios-users@lists.sourceforge.net<BR><B>Subject:</B> [Nagios-users] Re: 
    Retrun code of 99 is out of bounds<BR><BR></FONT></DIV><TT>This quite simply 
    means that when the program excuted</TT> <BR><TT>an error occured which 
    Nagios could not interpret,</TT> <BR><TT>hence its "out of bounds" 
    message.</TT> <BR><TT>Nagios is looking for return codes of 0,1,2,(3)</TT> 
    <BR><TT>(not sure of the three but there is a third return code associated 
    with</TT> <BR><TT>unknown errors)</TT> <BR><TT>So when it receives a return 
    code other than the 4 above</TT> <BR><TT>it displays an error of "return 
    code ## is out of bounds."and</TT> <BR><TT>goes into an "other than ok" 
    state.</TT> <BR><TT>this is a good indication something is happening behind 
    the</TT> <BR><TT>scenes. The best way to determine the actual  error is 
    to execute the</TT> <BR><TT>plugin with the same switches as in your service 
    check with the</TT> <BR><TT>same user that you excute the Nagios daemon 
    with.</TT> <BR><TT>This should spit out additional information that was 
    not</TT> <BR><TT>displayed when the service check ran inside of 
    Nagios.</TT><TT></TT> 
    <P><TT>Again the above error is the programs way of interpreting</TT> 
    <BR><TT>errors that fall outside of the realm it is accustomed to 
    seeing.</TT> <BR>  
    <P>I hope this helps.. <BR>Kenneth Ray 
    <P>nagios-users-request@lists.sourceforge.net wrote: 
    <BLOCKQUOTE TYPE="CITE">Message: 1 <BR>From: "Kaplan, Andrew H." 
      <AHKAPLAN@PARTNERS.ORG> <BR>To: nagios-users@lists.sourceforge.net 
      <BR>Date: Wed, 2 Oct 2002 14:30:35 -0400 <BR>Subject: [Nagios-users] 
      Return code of 99 is out of bounds 
      <P>What is the cause for a RETURN CODE OF 99 IS OUT OF BOUNDS ERROR? It is 
      showing <BR>up while checking the http daemon on the remote host. 
      <P>--__--__-- <BR> </P></BLOCKQUOTE><PRE>-- 
this message and any attachments are confidential to the ordinary user of
the e-mail address to which it was addressed and may also be privilaged. 
If you receive this message in error please immediately delete it and all
 copies of it from your system, destroy any hard copies of it and notify 
the sender. You must not, directly or indirectly, use, disclose,distribute,
print or copy any part of this message if you are not the intended 
resipient. Internet communications cannot be guaranteed to be secure 
or error-free as information could be intercepted, corrupted, lost, 
arrive late or contain viruses or unauthorized amendments. The sender,
therfore, does not accept liability for any errors or ommission in the
content of this message or any damage or other consequences arising as 
a result of Internet Transmition. Opinions, conclusions and/or
other information in this transmitted messxage that do not relate 
to official business of CITIGROUP shall be understood as neither given 
nor endorsed by CitiGroup.</PRE>  </BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>