Global Event Handlers

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
klee
Posts: 147
Joined: Fri Apr 04, 2014 2:31 pm

Global Event Handlers

Post by klee »

If Global Event Handers are enabled, can individual Event Handlers still be enabled for use with specific hosts/services?

Thanks,

-klee
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Global Event Handlers

Post by abrist »

Yes.
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.
klee
Posts: 147
Joined: Fri Apr 04, 2014 2:31 pm

Re: Global Event Handlers

Post by klee »

I've changed the settings for the Global Event Handler component to use the following scripts for [Host State Change Handler Commands] and [Service State Change Handler Commands], respectively.

/tmp/host_change_handler.sh --host="%host%" --hoststate=%hoststate% --hoststateid=%hoststateid% --lasthoststate=%lasthoststate% --lasthoststateid=%lasthoststateid% --hoststatetype=%hoststatetype% --currentattempt=%currentattempt% --maxattempts=%maxattempts% --hosteventid=%hosteventid% --hostproblemid=%hostproblemid% --hostoutput="%hostoutput%" --hostdowntime=%hostdowntime%

/tmp/service_change_handler.sh --host="%host%" --service="%service%" --hoststate=%hoststate% --servicestate=%servicestate% --servicestateid=%servicestateid% --lastservicestate=%lastservicestate% --lastservicestateid=%lastservicestateid% --servicestatetype=%servicestatetype% --currentattempt=%currentattempt% --maxattempts=%maxattempts% --serviceeventid=%serviceeventid% --serviceproblemid=%serviceproblemid% --serviceoutput="%serviceoutput%" --servicedowntime=%servicedowntime%

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

However, according to the documentation for Global Event Handlers, I'm also supposed to edit nagios.cfg in the format below, where "the command argument is the short name of a command that you define in your object configuration file".

http://nagios.sourceforge.net/docs/3_0/ ... nt_handler
Global Host Event Handler Option
Format: global_host_event_handler=<command>

http://nagios.sourceforge.net/docs/3_0/ ... nt_handler
Global Service Event Handler Option
Format: global_service_event_handler=<command>

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Am I supposed to define the command via Core Configuration Manager (as I did when defining commands for individual event handlers)?

If so, why are Global Event Handlers defined in 2 places? If not, please tell me what I'm doing wrong.

Thanks,

-klee
Last edited by klee on Thu May 22, 2014 10:22 am, edited 1 time in total.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Global Event Handlers

Post by sreinhardt »

If you are using the global event handlers component, which it sounds like you are, there is no need to alter the nagios.cfg file. The component handles all of the additional work like that and kicks off the requested event handler. Maybe I missed it, but what issues are you having presently, it sounds like you setup most of this correctly.
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.
klee
Posts: 147
Joined: Fri Apr 04, 2014 2:31 pm

Re: Global Event Handlers

Post by klee »

Can you please help me decipher this portion of the instruction for global_host_event_handler and global_service_event_handler? Please?

http://nagios.sourceforge.net/docs/3_0/ ... nt_handler

Because, if I only need to edit the Global Event Handler configuration page, then why does the documentation say what it does?

Plus, if I have to edit the command object (that being command.cfg), isn't that what I do for individual event handlers as opposed to global?

Any help would be greatly appreciated.

Thanks,

-klee
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Global Event Handlers

Post by sreinhardt »

That documentation is specifically in relation to core, if you were just using core you would need to do those changes as well. Considering we are discussing XI, I would suggest looking at the global event handler documentation specifically, and see if that clears things up for you!

http://assets.nagios.com/downloads/nagi ... ndlers.pdf
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.
klee
Posts: 147
Joined: Fri Apr 04, 2014 2:31 pm

Re: Global Event Handlers

Post by klee »

Thank You,

Yes, I've reviewed these documents.

But since Nagios doesn't provide a whole lot of documentation on (Global) Event Handlers, I decided to "cover my bases" and review all available documentation for Event Handlers.

Not to mention, the line between Core and XI seem really blurred, since I keep getting referred to docs for core regardless that I'm implementing XI.

Thank you for the clarification, but please don't close this thread.

If I can manage to un-break my XI system (see "Unable to delete host" thread), I will test out Global Event Handler as you've specified ASAP.

Thanks,

-klee
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Global Event Handlers

Post by abrist »

klee wrote: Thank you for the clarification, but please don't close this thread.
No prob.
klee wrote:Not to mention, the line between Core and XI seem really blurred, since I keep getting referred to docs for core regardless that I'm implementing XI.
XI uses some agents/etc that core also uses like nrpe/nsca/npcd/etc. So, depending on the question, you may want to look at XI and/or core docs for the answer.
klee wrote:If I can manage to un-break my XI system (see "Unable to delete host" thread), I will test out Global Event Handler as you've specified ASAP.
We will do what we can on that thread then. The XI introduction to event handlers doc (http://assets.nagios.com/downloads/nagi ... ndlers.pdf) was written by yours truly, so I will make my self available for any questions that you may have through the process (through this thread or PMs).
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.
klee
Posts: 147
Joined: Fri Apr 04, 2014 2:31 pm

Re: Global Event Handlers

Post by klee »

Thank you abrist & sreinhardt.

Going forward, I would really appreciated any assistance you guys can offer on the (Global) Event Handlers.

Much Appreciated,

-klee
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Global Event Handlers

Post by abrist »

Take a look at the other thread, I may have a resolution for you there.
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.
Locked