Customized macros not working for contacts

Paul Dubuc work at paul.dubuc.org
Fri May 4 15:01:06 CEST 2012


Is is feasible to define the macro in a service template definition that your 
other service definitions use to get the value for the command-line parameter?

Deborah Martin wrote:
> Andreas,
>
> It doesn't work if I define a customized macro in the contact definition
> and try to use it at all!
>
> That means as a macro or as an environment variable.
>
> If I move the customized macro to my service definition then both work.
>
> The docs say this is supported so I believe this should be fixed. My
> configuration "is in the real world" and therefore would be very useful. As
> it's for use with an event handler I can't believe that it will have that
> much of a performance impact as the only time when the event handler needs
> to send out results is on a critical alert and that is based on certain
> criteria being met.
>
> Having the macro defined in the contact definition instead of the service
> definition is the difference between updating 1 contacts.cfg file which
> contain 30 different contacts versus updating 100's of service definitions
> where there is around 10 services for every contact.
>
> Regards, Deborah
>
>
> -----Original Message----- From: Andreas Ericsson [mailto:ae at op5.se] Sent:
> 04 May 2012 12:25 To: Deborah Martin Cc: Nagios Developers List Subject:
> Re: [Nagios-devel] Customized macros not working for contacts
>
> On 05/03/2012 04:58 PM, Deborah Martin wrote:
>> 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 ?
>>
>
> Use the macro as a command-line parameter from Nagios' config. From what I
> read in your original mail, that seemed to work well, no?
>


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