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

s_aiello at comcast.net s_aiello at comcast.net
Wed Mar 26 19:46:55 CET 2008


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



More information about the Xymon mailing list