Page 1 of 1

Re: [Nagios-devel] Custom Object Variables: Contrary to docs,

Posted: Mon Aug 30, 2010 4:39 am
by Guest
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10-08-28 11:30 AM, "Peter Valdemar Mørch (Lists)" wrote:
> On 2010-08-28 15:59, Ethan Galstad egalstad-at-nagios.org |Lists/Send to
> lists| wrote:
>> Thanks for pointing this discrepancy out. Custom macros should be
>> cleaned IMO, so I opted to update the docs instead. :-)
>
> Could this please be a configuration option then? Sometimes there are
> things that need to contain these characters.
>
> - Windows services and shares sometimes actually have a $ in them
> - Passwords can have special chars in them (that is even encouraged)
> - The empty string is not representable because ' and " are illegal.
>
> The reason I hunted the discrepancy down is that we have a need for the
> special chars, e.g. for the things above.
>
> Or, instead of simply removing them, would it be possible to
> backslash-escape them? That way they won't be dangerous any longer.
>
> Hoping for a config option or other good solution,
>
> Peter

FWIW there are different kind of cleansing and encoding for macros, and
I think we would have the best of both worlds if we could configure
them, either trough an option mask or using specific prefixes.

just to give some ideas...

__NONE_SOME_MACRO This macro gets no option

__CLEAN__ESCAPE_ANOTHER_MACRO This macro gets cleaned & escaped

__URL_SOME_OTHER_MACRO http://example.com/foo&param=This url gets
url-encoded

Or if we want to apply properties...
_SOME_MACRO This macros will get no option
__PROPS_SOME_MACRO n

_ANOTHER_MACRO This macro will get cleaned & escaped
__PROPS_ANOTHER_MACRO c,e

_SOME_OTHER_MACRO http://example.com/foo&param=This url will get url-encoded
__PROPS_SOME_OTHER_MACRO u

The devault props could also figure in nagios.cfg, or be defined in a
template with __PROPS alone...

- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx7Q/sACgkQ6dZ+Kt5BchahZgCfR+rf5FrZu2FmWB+E9YYcN/UB
zPcAoLROhtmbIw0t8GAxhk8u8gQKhPM9
=k7pG
-----END PGP SIGNATURE-----





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