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 # Icingabeat supports capturing of an evenstream and periodical polling of the
# Icinga status data. # Icinga status data.
#
# To disable the eventstream, comment out the whole section
eventstream: eventstream:
#
# Decide which events to receive from the event stream. # Decide which events to receive from the event stream.
# The following event stream types are available: # The following event stream types are available:
#
# * CheckResult # * CheckResult
# * StateChange # * StateChange
# * Notification # * Notification
@ -41,7 +41,7 @@ icingabeat:
# * DowntimeStarted (See https://github.com/Icinga/icingabeat/issues/1) # * DowntimeStarted (See https://github.com/Icinga/icingabeat/issues/1)
# * DowntimeTriggered (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: types:
- CheckResult - CheckResult
- StateChange - StateChange
@ -55,5 +55,5 @@ icingabeat:
# pattern "mysql*": # pattern "mysql*":
# filter: 'match("mysql*", event.service)' # 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: "" 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.") logp.Info("icingabeat is running! Hit CTRL-C to stop it.")
bt.client = b.Publisher.Connect() bt.client = b.Publisher.Connect()
eventstream = NewEventstream(bt, bt.config) if len(bt.config.Eventstream.Types) > 0 {
go eventstream.Run() eventstream = NewEventstream(bt, bt.config)
go eventstream.Run()
}
for { for {
select { select {

View File

@ -24,11 +24,11 @@ icingabeat:
# Icingabeat supports capturing of an evenstream and periodical polling of the # Icingabeat supports capturing of an evenstream and periodical polling of the
# Icinga status data. # Icinga status data.
#
# To disable the eventstream, comment out the whole section
eventstream: eventstream:
#
# Decide which events to receive from the event stream. # Decide which events to receive from the event stream.
# The following event stream types are available: # The following event stream types are available:
#
# * CheckResult # * CheckResult
# * StateChange # * StateChange
# * Notification # * Notification
@ -41,7 +41,7 @@ icingabeat:
# * DowntimeStarted (See https://github.com/Icinga/icingabeat/issues/1) # * DowntimeStarted (See https://github.com/Icinga/icingabeat/issues/1)
# * DowntimeTriggered (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: types:
- CheckResult - CheckResult
- StateChange - StateChange
@ -55,7 +55,7 @@ icingabeat:
# pattern "mysql*": # pattern "mysql*":
# filter: 'match("mysql*", event.service)' # 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: "" filter: ""
#================================ General ====================================== #================================ General ======================================

View File

@ -24,11 +24,11 @@ icingabeat:
# Icingabeat supports capturing of an evenstream and periodical polling of the # Icingabeat supports capturing of an evenstream and periodical polling of the
# Icinga status data. # Icinga status data.
#
# To disable the eventstream, comment out the whole section
eventstream: eventstream:
#
# Decide which events to receive from the event stream. # Decide which events to receive from the event stream.
# The following event stream types are available: # The following event stream types are available:
#
# * CheckResult # * CheckResult
# * StateChange # * StateChange
# * Notification # * Notification
@ -41,7 +41,7 @@ icingabeat:
# * DowntimeStarted (See https://github.com/Icinga/icingabeat/issues/1) # * DowntimeStarted (See https://github.com/Icinga/icingabeat/issues/1)
# * DowntimeTriggered (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: types:
- CheckResult - CheckResult
- StateChange - StateChange
@ -55,7 +55,7 @@ icingabeat:
# pattern "mysql*": # pattern "mysql*":
# filter: 'match("mysql*", event.service)' # 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: "" filter: ""
#================================ General ===================================== #================================ General =====================================