Re: [Nagios-devel] Double escaping when using $ARGS1$?

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 when using $ARGS1$?

Post by Guest »

--001636c599f66749aa046a62fff4
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hi,

Not sure if this helps,
I always put my " in the Command definition like such

define command {
command_name my_plugin_with_args
command_line /plugins/my_plugin -a "$ARG1$"
}
this seems to be the easiest way to avoid issues,
this seems to work well for at least Check_nt (the one I use the most)

there has also been several questions on the $ needing $$ posted to the
Nagios User list over the last few years.


Maybe the Docs could use a subsection on escape characters and common usage
instead of a code patch?
How would changing this behavour affect existing configurations?


I think Andreas may have a good opinion/insight on this behaviour

Good Luck,
Tony


On Wed, May 20, 2009 at 9:02 AM, Marc Powell wrote:

>
> On May 19, 2009, at 7:09 PM, Ton Voon wrote:
>
> > Is this correct behaviour? I think this is wrong, or at least
> > inconsistent.
>
> It's documented as being this way to allow you to escape '!' in
> command arguments... I can see that it makes sense because you're
> adding another layer of substitution above the shell and the \-escape
> handling is probably not '!' specific.
>
> http://nagios.sourceforge.net/docs/3_0/macros.html
>
> "Tip: If you need to pass bang (!) characters in your command
> arguments, you can do so by escaping them with a backslash (\). If you
> need to include backslashes in your command arguments, they should
> also be escaped with a backslash. "
>
> --
> Marc
>
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables
> unlimited royalty-free distribution of the report engine
> for externally facing server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Nagios-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/lis ... gios-devel
>

--001636c599f66749aa046a62fff4
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,
=A0
Not sure if this helps,
I always put my " in the Command definition like such
=A0
define command {=A0=A0=A0=A0=A0=A0 command_name my_plugin_with_arg=
s=A0=A0=A0=A0=A0=A0 command_line /plugins/my_plugin -a "$ARG1$&quo=
t;}
this seems to be the easiest way to avoid issues,
this=A0seems to work well for at least Check_nt=A0 (the one I use the =
most)
=A0
there has also been several questions on the $ needing $$ posted to th=
e Nagios User list over the last few years.
=A0
=A0
Maybe the Docs could use a subsection on escape characters and common =
usage instead of a code patch?
How would changing this behavour affect existing configurations?
=A0
=A0
I think Andreas may have a good opinion/insight on this behaviour
=A0
Good Luck,
Tony
=A0
On Wed, May 20, 2009 at 9:02 AM, Marc Powell <[email protected]> wrote:

On May 19, 2009, at 7:09 PM, Ton Voon wrote:&=
gt; Is this correct behaviour? I think this is wrong, or at least> i=
nconsistent.It's documented as being this way to allow yo=
u to escape '!' in
command arguments... I can see that it makes sense because you'read=
ding another layer of substitution above the shell and the \-escapehand=
ling is probably not '!' specific.http://nagios.sourc=
eforge.net/docs/3_0/macros.

...[email truncated]...


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