Return code of 127 is out of bounds - only on high cpu load though

Andreas Ericsson ae at op5.se
Wed Dec 15 10:51:04 CET 2010


On 12/14/2010 06:39 PM, Daniel Wittenberg wrote:
> I ran a full strace of nagios daemon and children and it looks like it
> was the enable_environment_macros that was causing:
> 
> [pid 20478] execve("/bin/sh", ["sh", "-c",  . . . . . ] = -1 E2BIG
> (Argument list too long)<0.000337>
> [pid 20478] exit_group(127)             = ?
> 
> I turned them off and that fixes things, but potentially breaks some
> other things in our setup, but for right now it's working.  Still odd
> that as I change the number hosts the env changes enough to push over
> the edge.  I ran same tests with only 300 hosts and it worked fine, just
> looks like at about 500 or so something changes in env.
> 

Ah. One of the environment macros contains a list of all hostgroups the
host is a member of, and unless I'm mistaken, a list of all member hosts
of the "first hostgroup" that the host is a member of. Those lists can be
huge so they can quickly fill up the environment variables. My guess is
that you pushed it over the limit when you added more services.

It's the same with 'servicegroups' and 'servicegroup members' for services
btw.

In short; Don't enable environment variables. In fact, I think I'll add a
deprecation notice for it in the code and warn people that it'll be removed
in early 2012, or at least modified so that the superhuge lists are no
longer created as environment variables no matter if they're enabled or not.
That should alleviate problems like this, which are quite frustrating to
track down.

-- 
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.

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
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