Xymon Mailing List Archive search

Alert Script page.log contains many: Argument list too long

3 messages in this thread

list S Aiello · Wed, 26 Mar 2008 14:46:55 -0400 ·
Hello All,

I was implementing a new alert script. After doing so I was checking my logs to make sure all was well. I noticed the server/logs/page.log had many:
"Could not launch paging script /hobbit/script.sh: Argument list too long". So I thought there was something wrong with my script. So I changed my script to something very simple to debug and came up with nothing.

So I started to dig into the code and found in hobbitd/do_alert.c:
	/* The child starts the script */
	execlp(recip->scriptname, recip->scriptname, NULL);
	errprintf("Could not launch paging script %s: %s\n",
		recip->scriptname, strerror(errno));
	exit(0);

Searched for the execlp function and found it nowhere in the Hobbit code.. so it must be system level.  Once I started to google for execlp + "Argument list too long", this seem to be quite a common problem. A snippet from one posting I found was:

and the explanation: in the linux kernel is the function execve(),
which is how all of the other exec() functions (execl, execlp, execle,
etc.) are actually implemented. the way it works is by creating a 128K
buffer at the top end of the memory space and copying the command line
and environment for the new process into this space. it then loads the
new program into memory, sets its argv and envp pointers, and jumps to
its entry point.

there's a lot more to it than that, but the point is that there is a
128K buffer which is the only thing "held" from the parent process to
the child. the "Argument list too long" error message is actually the
kernel's E2BIG error code, returned when the execve() is not able to
fit the supplied argument list and environment into the 128K buffer.

Hobbit server is 4.2.0 + allinone on a RHEL 4 update 4.  So this is over my head, I know it isn't my script. My the status message is too big for the execlp buffer ? not sure if there is a way for me to increase that buffer, yet.

Thanks,
 ~Steve
list Henrik Størner · Wed, 26 Mar 2008 22:36:13 +0100 ·
quoted from S Aiello
On Wed, Mar 26, 2008 at 02:46:55PM -0400, user-ce96540ed38f@xymon.invalid wrote:
Hello All,

I was implementing a new alert script. After doing so I was checking my logs 
to make sure all was well. I noticed the server/logs/page.log had many:
"Could not launch paging script /hobbit/script.sh: Argument list too long".
[...]
there's a lot more to it than that, but the point is that there is a
128K buffer which is the only thing "held" from the parent process to
the child. the "Argument list too long" error message is actually the
kernel's E2BIG error code, returned when the execve() is not able to
fit the supplied argument list and environment into the 128K buffer.
This was discussed recently. See
http://www.hswn.dk/hobbiton/2008/01/msg00015.html


Regards,
Henrik
list S Aiello · Wed, 26 Mar 2008 19:52:47 -0400 ·
quoted from Henrik Størner
On Wednesday 26 March 2008, Henrik Stoerner wrote:
Hello All,

I was implementing a new alert script. After doing so I was checking my
logs to make sure all was well. I noticed the server/logs/page.log had
many: "Could not launch paging script /hobbit/script.sh: Argument list
too long".
[...]
there's a lot more to it than that, but the point is that there is a
128K buffer which is the only thing "held" from the parent process to
the child. the "Argument list too long" error message is actually the
kernel's E2BIG error code, returned when the execve() is not able to
fit the supplied argument list and environment into the 128K buffer.
This was discussed recently. See
http://www.hswn.dk/hobbiton/2008/01/msg00015.html
Ha...  Maybe if I used the correct google parameters I would of seen that 
article. To search the archives I used:
"Argument list too long" site:hobbitmon.com

I should of been using:
"Argument list too long" site:hswn.dk

And I had been so proud of myself in digging into that issue. Sorry for 
flooding the list with such a long winded email ;)

 ~Steve