macro referencing in host/serviceextinfo notesdirective

Ethan Galstad nagios at nagios.org
Thu Dec 14 06:24:00 CET 2006


Thomas Guyot-Sionnest wrote:
>> -----Original Message-----
>> From: nagios-devel-bounces at lists.sourceforge.net [mailto:nagios-devel-
>> bounces at lists.sourceforge.net] On Behalf Of Rob Brown
>> Sent: Wednesday, October 25, 2006 16:05
>> To: nagios-devel at lists.sourceforge.net
>> Subject: [Nagios-devel] macro referencing in host/serviceextinfo
>> notesdirective
>>
>> 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=$HOSTNAM
>> E$&service=$SERVICEDESC$">Click
>> Here for some other information about $SERVICEDESC$ on $HOSTNAME$</a>
>> 	}
> 
> Yep, would be very useful. I personally point action_url to the commands
> screen so I can send it in emails (plain-text). With the feature you suggest
> I could send HTML mails (I don't especially like this but windows guys love
> them) and include a notes macro just like the one you described.
> 
> Thomas
> 
> 

Support for the $HOSTNOTES$ and $SERVICENOTES$ macros to be able to 
contain other macros will be in CVS shortly (for Nagios 3).  Thanks for 
the suggestion!


Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV




More information about the Developers mailing list