macro referencing in host/serviceextinfo notes directive

Rob Brown dtownrobbrown at gmail.com
Wed Oct 25 22:05:02 CEST 2006


I have been experimenting with using the host/serviceextinfo
definitions to add some external links to information about
hosts/services. One thing I noticed while messing about is that the
"notes_url" and "action_url" directives seem to be able to do macro
replacement, while the "notes" directive does not. It would be quite
helpful to be able to use certain macros (like $HOSTNAME$,
$HOSTALIAS$, etc) in the notes. For example:
define hostextinfo{
	hostgroup_name	hostgroup1
	notes		<a href="http://webserver.localhost.localdomain/hostinfo.pl?host=$HOSTNAME$">Click
Here for some external information about $HOSTNAME$</a><br><a
href="http://webserver2.localhost.localdomain/hostinfo2.pl?host=$HOSTNAME$">Click
Here for some other information about $HOSTNAME$</a>
	}
define serviceextinfo{
	hostgroup_name         hostgroup1
	service_description	someservice
	notes			<a href="http://webserver.localhost.localdomain/serviceinfo.pl?host=$HOSTNAME$&service=$SERVICEDESC$">Click
Here for some external information about $SERVICEDESC$ on
$HOSTNAME$</a><br><a
href="http://webserver2.localhost.localdomain/serviceinfo.pl?host=$HOSTNAME$&service=$SERVICEDESC$">Click
Here for some other information about $SERVICEDESC$ on $HOSTNAME$</a>
	}
You might say: "Well why not just use the "notes_url" or "action_url"
directives?"
My answer is a bit petty: I just don't like the way they are
displayed: way off to the side with the generic "extra host notes"
text. I would rather have more control by being able to put in the
html myself and have multiple links as in the examples above.
It would be nice just to have the option of using macros here if you choose.
I'm not sure how this would affect the $HOSTNOTES$ and $SERVICENOTES$
macros, as obviously any macros contained within would need to be
expanded first. I'll leave that up to one of you sharp developers to
figure out.
Perhaps it would make more sense to re-think the way the "notes_url"
or "action_url" directives are defined and allow a little more
flexibility there. This is all in an effort to make nagios a central
admin tool and pull in (or at least link to) info from other souces.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the Developers mailing list