[Nagiosplug-help] Macros not evaluated in hostextinfo definition?

Ralph.Grothe at itdz-berlin.de Ralph.Grothe at itdz-berlin.de
Tue Dec 19 12:38:20 CET 2006


Hello all,

I apologize for posting my question about a basic nagios
configuration question
relatively unrelated to nagios plugins rather here than in the
nagios users' list.
But the knowledgeable members of this list seem to be much more
supportive
I have experienced, which I hereby shamelessly exploit.

I defined something like the below in various hostextinfo blocks.
The notes_url should direct to the useful Perl based ISA tool for
Informix databases.
Because the uri is base64 authentication "protected" I would like
to make use of
a few macro definitions to avoid hard coded credentials appearing
in clear in the nagios config files.

So the $USER15$ contains these credentials as expected as a
string of "username:password".
As you can see I also refer to an on-demand macro definition
"HOSTADDRESS:somehost$
which refers to the primary cluster node that hosts that
respective db instance as a cluster package.
$USER17$ simply contains the port the ISA webserver is listening
on.
And finally, the sole query path argument value contains the db
instance.


define hostextinfo {
    ...
    notes_url
http://$USER15$@$HOSTADDRESS:somehost$:$USER17$/isa/bin/summary.p
l?env=some_ids_inst
    ...
}


Unfortunately nagios isn't expanding the macros as I would have
wished.
Instead it simply omitted any substitutions and made up this sham
url:

http://:/isa/bin/summary.pl?env=ahw32_shm


So I guess that macro substitution is generally not supported in
hostextinfo context.
Is there another way how to configure this then without hard
coding the exact urls?

Regards

Ralph





More information about the Help mailing list