From: Andreas E. <ae...@op...> - 2012-04-26 07:23:03
|
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 and...@op... 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. |