event_handlers macro contactemail

Carlos de Sousa Carlos.de_Sousa at ericsson.com
Thu Mar 9 20:02:26 CET 2006


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
}

define host {
  use               NOC-MAIN
  host_name         host1
  alias             my host1
  address           xxx.xxx.xxx.xxx
  check_command     check-host-alive
}

Any other suggestion?

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

I have seen the mailing list archives, and there are other
people that have asked for the same thing, but they where
running Nagios V1 I think, so I wonder if this is duable
for Nagios V2.

Really greatfull for a solution, and no, I am not going to use the
CONTACTEMAIL information to send out notifications from my event handler.

Regards
Carlos

-- 
Carlos de Sousa

Ericsson AB
Phone: +46 8 56860605
Mail: Carlos.de_Sousa at ericsson.com

Disclaimer

This communication is confidential and intended solely for the 
addressee(s). Any unauthorized review, use, disclosure or distribution 
is prohibited. If you believe this message has been sent to you in 
error, please notify the sender by replying to this transmission and 
delete the message without disclosing it. Thank you.

E-mail including attachments is susceptible to data 
corruption,interruption, unauthorized amendment, tampering and viruses, 
and we only send and receive e-mails on the basis that we are not liable 
for any such corruption, interception, amendment, tampering or viruses 
or any consequences thereof.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Carlos.de_Sousa.vcf
Type: text/x-vcard
Size: 161 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20060309/116e6952/attachment.vcf>


More information about the Users mailing list