<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>Exit Code 137 using NRPE</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2 FACE="Arial">I am running a simple service check using NRPE:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">on the Nagios host if I run it manually like:</FONT>
<BR><FONT SIZE=2 FACE="Arial"># /usr/local/nagios/libexec/check_nrpe -H pokemon -c check_maj -t 180</FONT>
<BR><FONT SIZE=2 FACE="Arial">Performance Check OK</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"># echo $?</FONT>
<BR><FONT SIZE=2 FACE="Arial">0</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">It works perfectly</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">The NAgios config to execute it is (basically what I ran manually)</FONT>
<BR><FONT SIZE=2 FACE="Arial">command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -t 180</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">The service definition is</FONT>
<BR><FONT SIZE=2 FACE="Arial"># Service definition</FONT>
<BR><FONT SIZE=2 FACE="Arial">define service{</FONT>
<BR><FONT SIZE=2 FACE="Arial"> use generic-service ; Name of service template to use</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"> host_name pokemon</FONT>
<BR><FONT SIZE=2 FACE="Arial"> service_description MAJ</FONT>
<BR><FONT SIZE=2 FACE="Arial"> is_volatile 0</FONT>
<BR><FONT SIZE=2 FACE="Arial"> check_period 24x7</FONT>
<BR><FONT SIZE=2 FACE="Arial"> max_check_attempts 3</FONT>
<BR><FONT SIZE=2 FACE="Arial"> normal_check_interval 1</FONT>
<BR><FONT SIZE=2 FACE="Arial"> retry_check_interval 1</FONT>
<BR><FONT SIZE=2 FACE="Arial"> contact_groups nagios-admins</FONT>
<BR><FONT SIZE=2 FACE="Arial"> notification_interval 120</FONT>
<BR><FONT SIZE=2 FACE="Arial"> notification_period 24x7</FONT>
<BR><FONT SIZE=2 FACE="Arial"> notification_options c,r</FONT>
<BR><FONT SIZE=2 FACE="Arial"> check_command check_nrpe!check_maj</FONT>
<BR><FONT SIZE=2 FACE="Arial">}</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">and yet when it runs under Nagios it always returns </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Current Status: CRITICAL </FONT>
<BR><FONT SIZE=2 FACE="Arial">Status Information: (Return code of 137 is out of bounds)</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">What is exit code 137?</FONT>
<BR><FONT SIZE=2 FACE="Arial">Any ideas?</FONT>
</P>
<BR>
<BR>
<BR>
<BR>
<P><FONT SIZE=2 FACE="Arial">The script it is running is nothing special</FONT>
<BR><FONT SIZE=2 FACE="Arial">it is simply</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">#!/usr/bin/ksh</FONT>
<BR><FONT SIZE=2 FACE="Arial">#echo "Performance Check OK|1:0.8:0.7:0.7"</FONT>
<BR><FONT SIZE=2 FACE="Arial">echo "Performance Check OK"</FONT>
<BR><FONT SIZE=2 FACE="Arial">exit 0</FONT>
</P>
</BODY>
</HTML><table><tr><td bgcolor=#ffffff><font color=#000000><pre>www.sensis.com.au
A leading Australian advertising, information
and directories business.
www.yellowpages.com.au
www.whitepages.com.au
www.citysearch.com.au
www.whereis.com.au
www.telstra.com.au
This email and any attachments are intended only for the use of the recipient and may be confidential and/or legally privileged.
Sensis Pty Ltd disclaims liability for any errors, omissions, viruses, loss and/or damage arising from using, opening or transmitting this email.
If you are not the intended recipient you must not use, interfere with, disclose, copy or retain this email and you should notify the sender immediately by return email or by contacting Sensis Pty Ltd by telephone on [+61 3 9201 4888]
</pre></font></td></tr></table>