<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1515" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=707182013-09092005><FONT face=Arial 
color=#0000ff size=2>Perhaps your initial if statement is failing?  I 
suggest that you add an else{} clause to the initial if{} regex match; put out 
some message and exit $ERRORS{UNKNOWN} for no match.  Other than that, 
maybe check the file permissions to ensure that it is executable by the nagios 
user.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=707182013-09092005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=707182013-09092005><FONT face=Arial 
color=#0000ff size=2>Hope this helps,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=707182013-09092005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=707182013-09092005><FONT face=Arial 
color=#0000ff size=2>Lynne Lawrence</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=707182013-09092005><FONT face=Arial 
color=#0000ff size=2>QSS/USCG</FONT></SPAN></DIV><BR>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> 
  nagiosplug-devel-admin@lists.sourceforge.net 
  [mailto:nagiosplug-devel-admin@lists.sourceforge.net] <B>On Behalf Of 
  </B>Aditya Ivaturi<BR><B>Sent:</B> Thursday, September 08, 2005 5:08 
  PM<BR><B>To:</B> nagiosplug-devel@lists.sourceforge.net<BR><B>Subject:</B> 
  [Nagiosplug-devel] plugin help<BR></FONT><BR></DIV>
  <DIV></DIV><BR><FONT face=sans-serif size=2>This is the first time I am trying 
  to write a plugin for Nagios. So please bear with me. We have an online 
  testing system and I am writing a plugin to check how many users are actually 
  taking a test. It is a module that is in built in the system and exported via 
  http. So all I do is call that page and dump the number out. Nothing 
  complicated. The code-block (perl) which dumps out is as follows:</FONT> 
  <BR><BR><BR><FONT face=sans-serif size=2>if ($content =~ m/<TD>Student 
  Cache<\/TD><TD>(\d*)<\/TD>/) {</FONT> <BR><FONT 
  face=sans-serif size=2>    if ($1>$critical) {</FONT> <BR><FONT 
  face=sans-serif size=2>        if ($verbose) {</FONT> 
  <BR><FONT face=sans-serif size=2>            
  print "CRITICAL: $1 Users Online > $critical Critical Status \t Critical 
  ErrorLev 2 | UsersOnline=$1;0;0;\n";</FONT> <BR><FONT face=sans-serif 
  size=2>        }</FONT> <BR><FONT face=sans-serif 
  size=2>        else {</FONT> <BR><FONT face=sans-serif 
  size=2>            print "CRITICAL: $1 Users 
  Online | UsersOnline=$1;0;0;\n";</FONT> <BR><FONT face=sans-serif 
  size=2>        }</FONT> <BR><FONT face=sans-serif 
  size=2>        exit $ERRORS{'CRITICAL'};</FONT> <BR><FONT 
  face=sans-serif size=2>    }</FONT> <BR><FONT face=sans-serif 
  size=2>    elsif ($1>$warning) {</FONT> <BR><FONT face=sans-serif 
  size=2>        if ($verbose) {</FONT> <BR><FONT 
  face=sans-serif size=2>            print 
  "WARNING: $1 # Users Online > $warning Warning Status \t Critical ErrorLev 
  1 | UsersOnline=$1;0;0;\n";</FONT> <BR><FONT face=sans-serif size=2>  
        }</FONT> <BR><FONT face=sans-serif size=2>    
      else {</FONT> <BR><FONT face=sans-serif size=2>    
          print "WARNING: $1 Users Online | 
  UsersOnline=$1;0;0;\n";};</FONT> <BR><FONT face=sans-serif size=2>  
        exit $ERRORS{'WARNING'};</FONT> <BR><FONT face=sans-serif 
  size=2>    }</FONT> <BR><FONT face=sans-serif size=2>    
  else {</FONT> <BR><FONT face=sans-serif size=2>        if 
  ($verbose) {</FONT> <BR><FONT face=sans-serif size=2>      
        print "OK: $1 Users Online - Status normal \t Normal 
  ErrorLev 0 | UsersOnline=$1;0;0;\n";</FONT> <BR><FONT face=sans-serif 
  size=2>        }</FONT> <BR><FONT face=sans-serif 
  size=2>        else {</FONT> <BR><FONT face=sans-serif 
  size=2>            print "OK: $1 Users Online | 
  UsersOnline=$1;0;0;\n";</FONT> <BR><FONT face=sans-serif size=2>    
      }</FONT> <BR><FONT face=sans-serif size=2>      
    exit $ERRORS{'OK'};</FONT> <BR><FONT face=sans-serif size=2>  
    }</FONT> <BR><FONT face=sans-serif size=2>}</FONT> <BR><BR><BR><FONT 
  face=sans-serif size=2>For e.g the output will look like:</FONT> <BR><BR><FONT 
  face=sans-serif size=2>OK: 12 Users Online | UsersOnline=12;0;0; 
  </FONT><BR><BR><FONT face=sans-serif size=2>where -w is 150 and -c is 200. But 
  nagios complains by saying "NRPE: Unable to read output". Is the format of the 
  output wrong or am I missing any steps?</FONT> <BR><BR><FONT face=sans-serif 
  size=2>--Turi</FONT> <BR><BR><BR><BR></BLOCKQUOTE></BODY></HTML>