Skip to main content
Solved

Event Handler and Downtime

  • June 1, 2022
  • 2 replies
  • 212 views

Forum|alt.badge.img+14

Hello Community,

I use Event Handler to realize remediation actions with others tools like Ansible,  AWX or Ansible Tower.

I’ve seen on a customer platform a 20.10, that the downtime is not a state who blocked an event handler to run.

According to the documentation the downtime just skip the notification process.

Anyone can confirm me is normal or it’s a bug ?

What workaround could be put in place about that ?

Regards,

Greg

Best answer by nezu

hello 
I can confirm that the downtime doesn’t stop the event handler, but you can workaround by adding to your event handler command some macros like $SERVICEDOWNTIME$ or $HOSTDOWNTIME$ (depend on what you set your downtime). If this value is 1 a downtime is set, if it’s 0 then no downtime is set.
So you can use it like that in the script that will be executed by the event handler 

 if [[ $downtime_number -eq 0 ]]; then
echo "no downtime set you can continue"
else
echo "a downtime is set do nothing"
fi

hopes it answer your question, Have a nice day 

2 replies

nezu
Centreonian
Forum|alt.badge.img+3
  • Centreonian
  • Answer
  • June 2, 2022

hello 
I can confirm that the downtime doesn’t stop the event handler, but you can workaround by adding to your event handler command some macros like $SERVICEDOWNTIME$ or $HOSTDOWNTIME$ (depend on what you set your downtime). If this value is 1 a downtime is set, if it’s 0 then no downtime is set.
So you can use it like that in the script that will be executed by the event handler 

 if [[ $downtime_number -eq 0 ]]; then
echo "no downtime set you can continue"
else
echo "a downtime is set do nothing"
fi

hopes it answer your question, Have a nice day 


Forum|alt.badge.img+14
  • Author
  • Builder ***
  • June 2, 2022

Hello @nezu 

Thank you so much ! :)

I really do check https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/macrolist.html

Regards,

Greg