Use of customized macro in CONTACT definition

Andreas Ericsson ae at op5.se
Thu Apr 26 09:22:41 CEST 2012


On 04/25/2012 08:07 PM, Deborah Martin wrote:
> Alex,
> 
> Thanks, but I set _EMAILID in my contact definition so by echoing it
> in my script via defining a service that calls that script as a
> plugin which has a contact defined as test-admin surely I have set
> it.
> 
> According to the docs, nagios prefixes custom macros with
> NAGIOS__CONTACT if it's a contact definition macro which it is. So
> the environment variable becomes  $NAGIOS__CONTACTEMAILID - note the
> two underlines are correct and the _ prefix in the definition is
> stripped. As documented it states it's to avoid name collision with
> $NAGIOS_<nagios_macro>  such as the macro $HOSTALIAS$ would expand to
> $NAGIOS_HOSTALIAS as an environment variable that can be used in
> scripts such as eventhandlers. But I could also have _HOSTALIAS which
> would expand to NAGIOS__SERVICEHOSTALIAS to make a distinction with
> NAGIOS_HOSTALIAS...
> 
> And as mentioned when i take that _EMAILID and put in my service
> definition instead, the same script that now does echo
> "EMAILID=$NAGIOS__SERVICEEMAILID" works but the only difference is
> I've moved the EMAILID from part of a contact definition to a service
> definition yet the docs supports custom macros in a contact
> definitions.
> 
> By docs I'm referring to the documentation link on the nagios web
> interface and search for macros.
> 

This might be fixed in latest svn trunk. Try out that one and see if
it flies for you. If it does, we'd love to hear it. If it doesn't,
we'd still love to hear it so we know we still have to fix it.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list