event_handlers macro contactemail

Marc Powell marc at ena.com
Thu Mar 9 20:40:51 CET 2006



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Carlos de Sousa
> Sent: Thursday, March 09, 2006 1:02 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] event_handlers macro contactemail
> 
> Hi!
> 
> I am in real need for having access to the $CONTACTx$ macros in my
> eventhandlers. I am running Nagios V2.
> 
> Would I get it to work if I did the following?
> 
> 
> define command {
>      command_name                   send_snmptrap_host
>      command_line                   /usr/bin/perl
> $USER1$/eventhandlers/send_nagiostrap $ARG1$ $ARG2$
> 
> }
> 
> define host {
>       name                           NOC-MAIN
> 
>       event_handler_enabled          1  ; Host event handler is
enabled
> 
> 
>       register                       0  ; DONT REGISTER THIS
DEFINITION
> 
>       notifications_enabled          0
>       event_handler
> send_snmptrap_host!$CONTACTEMAIL$!$CONTACTPAGER$
>       contact_groups                 NOC
> }
> 

No, the $CONTACT*$ macros are not available to event handlers. See the
chart at --

http://nagios.sourceforge.net/docs/2_0/macros.html


> Any other suggestion?

Why not make a contact whose notification command runs
send_nagiostrap_host and associate them with that host? You could also
build in logic into send_nagiostrap_host to gather that information from
some other source or the nagios config files themselves if the contact
route isn't acceptable to you.

> 
> would it work if I put the event_handler keyword in the host
> definition for the host instead of in a template?

No, they're just not available to the event_handler subsystem at all.
 
--
Marc 


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
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