Page 1 of 1
Event handler sending notifications after every check
Posted: Thu Jul 16, 2020 8:21 am
by aceadm
Might be a starter question but after I set up my own event handler and placed it on a host (basically a script sending an alarm), I am getting an alarm every 5 minutes (every check that nagios does basically). I've read about Soft and Hard state of hosts but didn't figure how to stop this behaviour.
I need to have the event handler work once, everytime the state changes and not everytime the check is happening and the state is the same.
Thanks in advance.
Re: Event handler sending notifications after every check
Posted: Thu Jul 16, 2020 3:46 pm
by benjaminsmith
Hi
@aceadm,
It sounds like the stat is changing frequently for this check and I would recommend checking the State History report to see what's happening, event handlers are called under the following conditions:
Event handlers are executed when a service or host:
Is in a SOFT problem state
Initially goes into a HARD problem state
Initially recovers from a SOFT or HARD problem state
You can also gain greater control of when Event Handlers are called by adding some logic to script and checking against standard macros, examples in the guide below.
Nagios XI Introduction to Event Handlers
Let me know what you find out when viewing the state history, Reports > State History, and select both state types.
Re: Event handler sending notifications after every check
Posted: Fri Jul 17, 2020 4:13 am
by aceadm
benjaminsmith wrote:Hi
@aceadm,
It sounds like the stat is changing frequently for this check and I would recommend checking the State History report to see what's happening, event handlers are called under the following conditions:
Event handlers are executed when a service or host:
Is in a SOFT problem state
Initially goes into a HARD problem state
Initially recovers from a SOFT or HARD problem state
You can also gain greater control of when Event Handlers are called by adding some logic to script and checking against standard macros, examples in the guide below.
Nagios XI Introduction to Event Handlers
Let me know what you find out when viewing the state history, Reports > State History, and select both state types.
You were right, I had to stop all SOFT messages from my script and pass only the HARD state type as I found in this post:
https://support.nagios.com/forum/viewto ... =6&t=51416
Thank you for your help!
Re: Event handler sending notifications after every check
Posted: Fri Jul 17, 2020 8:09 am
by scottwilkerson
aceadm wrote:benjaminsmith wrote:Hi
@aceadm,
It sounds like the stat is changing frequently for this check and I would recommend checking the State History report to see what's happening, event handlers are called under the following conditions:
Event handlers are executed when a service or host:
Is in a SOFT problem state
Initially goes into a HARD problem state
Initially recovers from a SOFT or HARD problem state
You can also gain greater control of when Event Handlers are called by adding some logic to script and checking against standard macros, examples in the guide below.
Nagios XI Introduction to Event Handlers
Let me know what you find out when viewing the state history, Reports > State History, and select both state types.
You were right, I had to stop all SOFT messages from my script and pass only the HARD state type as I found in this post:
https://support.nagios.com/forum/viewto ... =6&t=51416
Thank you for your help!
May we close this case?