Skip to content

Commit

Permalink
Add : no_event_handlers_during_downtimes parameter to choose between …
Browse files Browse the repository at this point in the history
…nagios and shinken behavior to (not) run event handlers during a downtime.
  • Loading branch information
naparuba committed Oct 2, 2011
1 parent eaa8969 commit 9ce28d8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion etc/nagios.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,8 @@ human_timestamp_log=0


# The arbiter can have it's own local log
local_log=arbiterd.log
local_log=arbiterd.log

# Set to 0 will enable the nagios behavior that will
# launch event handlers even if the element is in downtime.
no_event_handlers_during_downtimes=1
3 changes: 2 additions & 1 deletion shinken/objects/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ class Config(Item):
'idontcareaboutsecurity': BoolProp(default='0'),
'flap_history': IntegerProp(default='20', class_inherit=[(Host, None), (Service, None)]),
'max_plugins_output_length': IntegerProp(default='8192', class_inherit=[(Host, None), (Service, None)]),

'no_event_handlers_during_downtimes': BoolProp(default='0', class_inherit=[(Host, None), (Service, None)]),

# Interval between cleaning queues pass
'cleaning_queues_interval' : IntegerProp(default='900'),

Expand Down
3 changes: 2 additions & 1 deletion shinken/objects/schedulingitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ def get_event_handlers(self, externalcmd=False):
return

# If we do not force and we are in downtime, bailout
if not externalcmd and self.in_scheduled_downtime:
# if the no_event_handlers_during_downtimes is 1 in conf
if cls.no_event_handlers_during_downtimes and not externalcmd and self.in_scheduled_downtime:
return

m = MacroResolver()
Expand Down
1 change: 1 addition & 0 deletions test/etc/nagios_1r_1h_1s.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,4 @@ use_retained_scheduling_info=1
use_syslog=0
use_true_regexp_matching=0
enable_problem_impacts_states_change=1
no_event_handlers_during_downtimes=1

0 comments on commit 9ce28d8

Please sign in to comment.