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 »


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've changed my mind about the exclamation mark though, but using it
> in a command_line statement for a command object shouldn't mean it
> requires escaping.

I'm fine with whatever the current rules for command_line are. I don't
plan on changing that.

> Also, I'd quite like to get a conditional parameter parsing thing for
> Nagios, so that one can do something like this:
>
> define command{
> command_name check_http
> command_line $USER1/check_http -H $HOSTADDRESS$ $?ARG1:-p$ $ARG1$
> }
>
> where '-p' and $ARG1$ only ever get added if they're actually
> configured.
> Possibly also only if they're non-nul strings.

Outside of scope for the moment :)

Ton





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