lib/flapjack/processor.rb in flapjack-0.9.6 vs lib/flapjack/processor.rb in flapjack-1.0.0rc1
- old
+ new
@@ -36,10 +36,12 @@
@events_archive_maxage = @config['events_archive_maxage']
ncsm_duration_conf = @config['new_check_scheduled_maintenance_duration'] || '100 years'
@ncsm_duration = ChronicDuration.parse(ncsm_duration_conf, :keep_zero => true)
+ @ncsm_ignore_tags = @config['new_check_scheduled_maintenance_ignore_tags'] || []
+
@exit_on_queue_empty = !! @config['exit_on_queue_empty']
options = { :logger => opts[:logger], :redis => @redis }
@filters = []
@filters << Flapjack::Filters::Ok.new(options)
@@ -206,10 +208,10 @@
previous_state = entity_check.state
if previous_state.nil?
@logger.info("No previous state for event #{event.id}")
- if @ncsm_duration > 0
+ if @ncsm_duration > 0 && (event.tags & @ncsm_ignore_tags).empty?
@logger.info("Setting scheduled maintenance for #{time_period_in_words(@ncsm_duration)}")
entity_check.create_scheduled_maintenance(timestamp,
@ncsm_duration, :summary => 'Automatically created for new check')
end