event handlers

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

event handlers

Post 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"
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: event handlers

Post by sreinhardt »

Not that I know of, however you certainly could have a script that calls both instead!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: event handlers

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: event handlers

Post 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
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: event handlers

Post 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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: event handlers

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: event handlers

Post 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
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: event handlers

Post by sreinhardt »

ok locking up. Let us know if it needs to be reopened.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked