[BUG] hobbitd_alert fails to execute script on large message
Hi,
I encounter a serious problem when using the following rule in hobbit-alerts.cfg :
EXSERVICE=_site SCRIPT=/usr2/hobbitlocal/bin/send_to foobar FORMAT=text RECOVERED REPEAT=6m
when BBALPHAMSG is large (ie a "procs" or "ports" on a very busy box), the log says :
2007-12-17 16:31:01 Could not launch paging script /usr2/hobbitlocal/bin/send_to: Argument list too long
The problem is with execlp in do_alert.c.
I could use a different format (sms) for columns such as ports/procs and other verbose ones, but it's not foolproof. (in the meantime, I'll do this anyway).
Maybe a safer approach would be to add a SIZELIMIT=xxx in hobbit-alerts.cfg or automatically crop the BBALPHAMSG depending on the local OS prior to execlp().
Regards,
-- Charles Goyard - charles.goyard at orange-ftgroup.com - (+33) 1 45 38 01 31 Orange Business Services - online multimedia // ingénierie
On Mon, Dec 17, 2007 at 04:43:51PM +0100, Charles Goyard wrote:
Hi,
I encounter a serious problem when using the following rule in hobbit-alerts.cfg :
EXSERVICE=_site SCRIPT=/usr2/hobbitlocal/bin/send_to foobar FORMAT=text RECOVERED REPEAT=6m
when BBALPHAMSG is large (ie a "procs" or "ports" on a very busy box), the log says :
2007-12-17 16:31:01 Could not launch paging script /usr2/hobbitlocal/bin/send_to: Argument list too long
The attached patch can be used to solve this, it puts an upper limit on the size of the status message passed through the BBALPHAMSG environment variable. The limit is defined at compile-time through a setting in the top-level Makefile.
I think this will apply on top of 4.2.0 as well.
Henrik
participants (2)
-
charles.goyard@orange-ftgroup.com
-
henrik@hswn.dk