[RESOLVED] Return code of 9 is out of bounds when plugin is runin nagios, but return code is 0 when run from shell

Samuel Kidman Samuel.Kidman at panres.com
Mon Sep 19 03:57:53 CEST 2011


Hi All

I managed to resolve this by changing the command definition. Not sure
why that was the cause of the problem, though.

Before I was just running it with $USER1$/name-of-plugin.pl

The way I got it to work was

/usr/bin/perl $USER1$/name-of-plugin.pl

Also I had left open some of the command macros, ie typing

$HOSTADDRESS

Instead of 

$HOSTADDRESS$

Hope this helps some other people with this issue.

Regards, Sam

-----Original Message-----
From: Andreas Ericsson [mailto:ae at op5.se] 
Sent: Wednesday, 14 September 2011 6:22 PM
To: Nagios Users List
Cc: Samuel Kidman
Subject: Re: [Nagios-users] Return code of 9 is out of bounds when
plugin is runin nagios, but return code is 0 when run from shell

On 09/14/2011 08:16 AM, Samuel Kidman wrote:
> The script is called from the nagios server itself, NRPE isn't
involved.
> It's really frustrating as I can't seem to find any source for the 
> error and I can't think of anymore troubleshooting steps or ways to 
> repeat the error outside of Nagios. Is there some way I can get more 
> detail on why this code is getting returned by using debugging options
in nagios.cfg?
> 

$ errid 9
  9  EBADF            Bad file descriptor

This means it's somehow related to filedescriptors. All plugins share
the number of open filedescriptors with Nagios, so if many plugins run
at the same time and the plugin is opening a lot of files or making a
lot of socket connections, you might end up with it breaking from
something like this.

Does the plugin return proper output or do you get the Nagios-generated
one?

Does it always break or only sometimes?

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war on
peace.

------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry® mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry® DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
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