Double escaping in $ARGx$

Ton Voon ton.voon at opsera.com
Tue Aug 11 14:37:38 CEST 2009


On 11 Aug 2009, at 10:40, Andreas Ericsson wrote:

> I mean that we can get rid of roughly 35-40% of the load from Nagios  
> by
> avoiding the extra fork()+execve() the shell causes by simply parsing
> the command ourselves.

I see. perl does something like that. You call system() with a string  
(like "/bin/echo here I am") and it works out if there are any shell  
meta characters in there. If so, it invokes via the shell, otherwise  
it splits it based on spaces and then calls execve().

So the usual definitions of "$USER1$/check_icmp -H hostname" will  
speed up, but something like "$USER1$/check_http -H hostname -s  
'string'" won't.

We could do something like that as well, though there's potential  
breakage with existing configurations.

I've never dug into perl's C code - this would be a handy excuse!

Ton


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july




More information about the Developers mailing list