Return code of 141 is out of bounds

Marc Powell marc at ena.com
Thu Oct 27 15:29:41 CEST 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Nico Rittner
> Sent: Thursday, October 27, 2005 4:36 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Return code of 141 is out of bounds
> 
> Hello,
> 
> if want to ping a host, and if that fails
> trace the route to it:
> 
> command_line	ping -c 4 2.3.4.5 || /usr/sbin/traceroute -n 2.3.4.5
> 2>&1
> 
> if the 'ping' fails ,nagios notifies me,
> but the expected output of traceroute is missing.
> If i run this command under some interactive shell
> as 'nagios' everything works.
> i also tried quoting the command, because nagios
> calls "sh -c <command>" .
> I don't want to write an extra script for that,
> so is there a way to do this directly in the config-file?

The short answer is no. Nagios expects very specific output from the
plugins which ping and traceroute do not conform to. See the Developer
Guidelines at http://nagiosplug.sf.net for specifics but the gist of it
is that you must return only 1 line of output and exit with the proper
exit code. At the very least you'll need to create a wrapper to return
the proper exit codes and manage the output.

--
Marc
 


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
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