From 292049a1aaaca2c3dd5152e4af68a6b2c6923109 Mon Sep 17 00:00:00 2001 From: Blerim Sheqa Date: Tue, 3 Jan 2017 10:05:23 +0100 Subject: [PATCH] Make it possible to disable eventstream completely --- _meta/beat.yml | 8 ++++---- beater/icingabeat.go | 6 ++++-- icingabeat.full.yml | 8 ++++---- icingabeat.yml | 8 ++++---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/_meta/beat.yml b/_meta/beat.yml index 7bbd0f94..a5972a2d 100644 --- a/_meta/beat.yml +++ b/_meta/beat.yml @@ -24,11 +24,11 @@ icingabeat: # Icingabeat supports capturing of an evenstream and periodical polling of the # Icinga status data. - # - # To disable the eventstream, comment out the whole section eventstream: + # # Decide which events to receive from the event stream. # The following event stream types are available: + # # * CheckResult # * StateChange # * Notification @@ -41,7 +41,7 @@ icingabeat: # * DowntimeStarted (See https://github.com/Icinga/icingabeat/issues/1) # * DowntimeTriggered (See https://github.com/Icinga/icingabeat/issues/1) # - # At least one type must be set + # To disable eventstream, leave the types empty or comment out the option types: - CheckResult - StateChange @@ -55,5 +55,5 @@ icingabeat: # pattern "mysql*": # filter: 'match("mysql*", event.service)' # - # Comment out this line if you don't want to set a filter at all + # To disable filtering set an empty string or comment out the filter option filter: "" diff --git a/beater/icingabeat.go b/beater/icingabeat.go index be6cebef..31b9082f 100644 --- a/beater/icingabeat.go +++ b/beater/icingabeat.go @@ -39,8 +39,10 @@ func (bt *Icingabeat) Run(b *beat.Beat) error { logp.Info("icingabeat is running! Hit CTRL-C to stop it.") bt.client = b.Publisher.Connect() - eventstream = NewEventstream(bt, bt.config) - go eventstream.Run() + if len(bt.config.Eventstream.Types) > 0 { + eventstream = NewEventstream(bt, bt.config) + go eventstream.Run() + } for { select { diff --git a/icingabeat.full.yml b/icingabeat.full.yml index 05a67591..7e5110e8 100644 --- a/icingabeat.full.yml +++ b/icingabeat.full.yml @@ -24,11 +24,11 @@ icingabeat: # Icingabeat supports capturing of an evenstream and periodical polling of the # Icinga status data. - # - # To disable the eventstream, comment out the whole section eventstream: + # # Decide which events to receive from the event stream. # The following event stream types are available: + # # * CheckResult # * StateChange # * Notification @@ -41,7 +41,7 @@ icingabeat: # * DowntimeStarted (See https://github.com/Icinga/icingabeat/issues/1) # * DowntimeTriggered (See https://github.com/Icinga/icingabeat/issues/1) # - # At least one type must be set + # To disable eventstream, leave the types empty or comment out the option types: - CheckResult - StateChange @@ -55,7 +55,7 @@ icingabeat: # pattern "mysql*": # filter: 'match("mysql*", event.service)' # - # Comment out this line if you don't want to set a filter at all + # To disable filtering set an empty string or comment out the filter option filter: "" #================================ General ====================================== diff --git a/icingabeat.yml b/icingabeat.yml index 594bd23a..bbb2f0ec 100644 --- a/icingabeat.yml +++ b/icingabeat.yml @@ -24,11 +24,11 @@ icingabeat: # Icingabeat supports capturing of an evenstream and periodical polling of the # Icinga status data. - # - # To disable the eventstream, comment out the whole section eventstream: + # # Decide which events to receive from the event stream. # The following event stream types are available: + # # * CheckResult # * StateChange # * Notification @@ -41,7 +41,7 @@ icingabeat: # * DowntimeStarted (See https://github.com/Icinga/icingabeat/issues/1) # * DowntimeTriggered (See https://github.com/Icinga/icingabeat/issues/1) # - # At least one type must be set + # To disable eventstream, leave the types empty or comment out the option types: - CheckResult - StateChange @@ -55,7 +55,7 @@ icingabeat: # pattern "mysql*": # filter: 'match("mysql*", event.service)' # - # Comment out this line if you don't want to set a filter at all + # To disable filtering set an empty string or comment out the filter option filter: "" #================================ General =====================================