Page 1 of 1

event handlers

Posted: Wed Apr 23, 2014 12:31 pm
by vvz
Hello!

Short question - Can I assign 2 event handlers for one host definition?

define host {
host_name test-condor-site
alias test-condor-site
address 172.16.37.44
check_command check-host-alive
max_check_attempts 5
check_interval 1
retry_interval 1
active_checks_enabled 1
check_period 24x7
contacts vassiliy,vassiliy-phone ;mike,mike-phone
#contact_groups admins
notification_interval 3
notification_period 24x7
notification_options d
notifications_enabled 1
event_handler asteriks-host-phone-call-vassiliy, asteriks-host-phone-call-mike
event_handler_enabled 1
}

it would solve my problem I'm discussing right now in another thread - "event handler"

Re: event handlers

Posted: Wed Apr 23, 2014 2:18 pm
by sreinhardt
Not that I know of, however you certainly could have a script that calls both instead!

Re: event handlers

Posted: Wed Apr 23, 2014 2:18 pm
by abrist
Unfortunately, you can only specify 1 event handler. You will need to create a wrapper script to run both of them. Pay attention to the macros - hosts and services do have a handful of slightly different macros.

Re: event handlers

Posted: Wed Apr 23, 2014 2:23 pm
by vvz
that's the problem - I wanna send a call to different people, depends on who is on duty today.
It's quite simple inside nagios using time periods, but to right a special script ... -yes it's possible, but I wanted to do everything in nagios

Re: event handlers

Posted: Wed Apr 23, 2014 2:25 pm
by vvz
would command accept more than 3 parameters in commands.cfg it's also quite simple, but unfortunately for now I can give only 3 parameters, I don't know why

Re: event handlers

Posted: Wed Apr 23, 2014 2:35 pm
by sreinhardt
Commands absolutely should take up to 9 within ccm or 254 within static files. On that note, you can also pass multiple items via one argument and as long as they are not quoted each space will be treated as normal, just like with the cli.

Re: event handlers

Posted: Wed Apr 23, 2014 2:41 pm
by vvz
yes, I understand that - like a normal bash script

I'm working on the problem.

I got the answer, so I believe we can close the thread

Thank you for your help, I really appreciate your help

Re: event handlers

Posted: Wed Apr 23, 2014 2:42 pm
by sreinhardt
ok locking up. Let us know if it needs to be reopened.