Customized macros not working for contacts

Deborah Martin Deborah.Martin at kognitio.com
Thu May 3 16:58:53 CEST 2012


Thanks Andreas, 

>> Are environment macros are turned on and large_installation_tweaks turned off? Otherwise, it's not supposed to work.
Yes for both settings 

I do see your point about a fix. It's a shame because setting this in the contact definition would have made some event handlers easier to write. 

At the moment my event handler has to be customized per customer to get the right email contacts but if I could define a customized macro in the contact definition, I only need 
use that in my event handler script and then I don't need to worry about a different event handler per customer making it as generic as possible. 
Things like warning and critical thresholds are parsed based on customer requirements rather than hardcoded so I was hoping I could do that with contacts. 

Is there a different way of achieving this ? 

Regards,
Deborah 


-----Original Message-----
From: Andreas Ericsson [mailto:ae at op5.se] 
Sent: 03 May 2012 15:46
To: Nagios Developers List
Cc: Deborah Martin
Subject: Re: [Nagios-devel] Customized macros not working for contacts

On 05/03/2012 12:42 PM, Deborah Martin wrote:
> Hi,
> 
> I'm running nagios 3.3.1 on sles 10.
> 
> I've defined a contact which uses a customized macro called 
> _EMAILCONTACTID
> 
> However, when I try to reference this macro, from a script defined to 
> run as part of a service check,  as an environment variable 
> $NAGIOS__CONTACTEMAILCONTACTID, is blank
> 

Are environment macros are turned on and large_installation_tweaks turned off? Otherwise, it's not supposed to work.

> If I define a customized macro in the service definition, I can see 
> the contents of $NAGIOS_SERVICEEMAILCONTACTID.
> 
> I've followed the docs and it does state that you can define a 
> customized macro in a contact definition, so this to me looks like a 
> bug in 3.3.1
> 
> When will a fix be available ?
> 

When someone sends in a patch, or when Eric and Ethan finds time to work on this. Environment macros are nifty to use in small installs but the performance penalty associated with them along with the weird errors that occur in large installations with many large groups of objects make them unsuitable for real-world usage, so I prefer to deter people from using them rather than fixing any problems with them (since the most severe problems just aren't fixable).

-- 
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.


This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you are not the intended recipient, please delete this e-mail immediately.  Any unauthorised distribution or copying is strictly prohibited.

Whilst Kognitio endeavours to prevent the transmission of viruses via e-mail, we cannot guarantee that any e-mail or attachment is free from computer viruses and you are strongly advised to undertake your own anti-virus precautions. Kognitio grants no warranties regarding performance, use or quality of any e-mail or attachment and undertakes no liability for loss or damage, howsoever caused.
------------------------------------------------------------------------------
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/




More information about the Developers mailing list