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.
Event handler sending notifications after every check
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Event handler sending notifications after every check
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:
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.
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:
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.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
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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Event handler sending notifications after every check
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: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: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.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
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.
https://support.nagios.com/forum/viewto ... =6&t=51416
Thank you for your help!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Event handler sending notifications after every check
May we close this case?aceadm wrote: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: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: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.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
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.
https://support.nagios.com/forum/viewto ... =6&t=51416
Thank you for your help!