Re: [Nagios-devel] Double escaping in $ARGx$

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Double escaping in $ARGx$

Post by Guest »

Ton Voon wrote:
> On 11 Aug 2009, at 09:30, Andreas Ericsson wrote:
>
>> Ton Voon wrote:
>>> On 31 Jul 2009, at 16:10, Ethan Galstad wrote:
>>>
>>> Andreas writes:
>>>> Why use the exclamation mark at all? It's quite straightforward to
>>>> parse
>>>> shell-style quoting into arguments, and that way users can just
>>>> cut-n-paste
>>>> the commands to verify that they work (assuming they replace the
>>>> macros,
>>>> that is).
>>> That's wrong. You use execve to avoid the shell quoting and to pass
>>> in
>>> arguments "as-is" to the plugin without interpretation at the shell
>>> level.
>> I'm well aware of that, but hand-parsing it inside Nagios would not be
>> difficult, assuming we can still pass commands with sub-shells to the
>> shell for execution.
>
> I'm not sure what you mean here. Can you give an example?
>

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. However, we shouldn't bother with commands that
include sub-shells or pipes, so a command such as this:

check_http -H example.com -p $(cat example.com.port) | grep -e expr

had better be handed over to the shell instead of us adding bidirectional
communication pipes and subcommand argument substitution inside Nagios.

--
Andreas Ericsson [email protected]
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.





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked