Make it possible to disable eventstream completely

This commit is contained in:
Blerim Sheqa 2017-01-03 10:05:23 +01:00
parent e981f87635
commit 292049a1aa
4 changed files with 16 additions and 14 deletions

View File

@ -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: ""

View File

@ -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 {

View File

@ -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 ======================================

View File

@ -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 =====================================