Move retry_interval setting to evenstream namespace

This commit is contained in:
Blerim Sheqa 2017-01-18 16:54:49 +01:00
parent 92fe7baaa2
commit 02d6e58153
7 changed files with 20 additions and 24 deletions

View File

@ -67,10 +67,6 @@ object ApiUser "icinga" {
#### `password`
Defaults to `icinga`
#### `retry_interval`
Instead of stopping on connection loss, Icingabeat will try to reconnect to the
API periodically. Defaults to `10s`
#### `skip_ssl_verify`
Skip verification of SSL certificates. Defaults to `false`
@ -110,6 +106,10 @@ Example for the CheckResult type with the service matching the string pattern
filter: 'match("mysql*", event.service)'
```
#### `retry_interval`
Instead of stopping on connection loss, Icingabeat will try to reconnect to the
API periodically. Defaults to `10s`
### Statuspoller
These settings are specific to the statuspoller mode.

View File

@ -16,9 +16,6 @@ icingabeat:
# Password of the user
password: "icinga"
# Defines how fast to reconnect to the API after a connection loss
retry_interval: 10s
# Skip SSL verification
skip_ssl_verify: false
@ -58,6 +55,9 @@ icingabeat:
# To disable filtering set an empty string or comment out the filter option
filter: ""
# Defines how fast to reconnect to the API on connection loss
retry_interval: 10s
statuspoller:
# Interval at which the status API is called. Set to 0 to disable polling.
interval: 60s

View File

@ -63,7 +63,7 @@ func (es *Eventstream) Run() error {
for {
ticker := time.NewTicker(es.config.RetryInterval)
ticker := time.NewTicker(es.config.Eventstream.RetryInterval)
response, responseErr := requestURL(es.icingabeat, "POST", URL)
if responseErr == nil {

View File

@ -2,7 +2,6 @@ package beater
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/url"
@ -70,8 +69,6 @@ func (sp *Statuspoller) Run() error {
case []interface{}:
for _, status := range statustype {
fmt.Println(status)
statusevent := common.MapStr{
"@timestamp": common.Time(time.Now()),
"type": "icingabeat.status",
@ -101,7 +98,7 @@ func (sp *Statuspoller) Run() error {
return nil
}
// Stop eventstream receiver
// Stop statuspoller
func (sp *Statuspoller) Stop() {
close(sp.done)
}

View File

@ -11,7 +11,6 @@ type Config struct {
Port int `config:"port"`
User string `config:"user"`
Password string `config:"password"`
RetryInterval time.Duration `config:"retry_interval"`
SkipSSLVerify bool `config:"skip_ssl_verify"`
Eventstream EventstreamConfig `config:"eventstream"`
Statuspoller StatuspollerConfig `config:"statuspoller"`
@ -19,8 +18,9 @@ type Config struct {
// EventstreamConfig optoins
type EventstreamConfig struct {
Types []string `config:"types"`
Filter string `config:"filter"`
Types []string `config:"types"`
Filter string `config:"filter"`
RetryInterval time.Duration `config:"retry_interval"`
}
// StatuspollerConfig options
@ -30,7 +30,6 @@ type StatuspollerConfig struct {
// DefaultConfig values
var DefaultConfig = Config{
RetryInterval: 1 * time.Second,
Host: "localhost",
Port: 5665,
Host: "localhost",
Port: 5665,
}

View File

@ -16,9 +16,6 @@ icingabeat:
# Password of the user
password: "icinga"
# Defines how fast to reconnect to the API after a connection loss
retry_interval: 10s
# Skip SSL verification
skip_ssl_verify: false
@ -58,6 +55,9 @@ icingabeat:
# To disable filtering set an empty string or comment out the filter option
filter: ""
# Defines how fast to reconnect to the API on connection loss
retry_interval: 10s
statuspoller:
# Interval at which the status API is called. Set to 0 to disable polling.
interval: 60s

View File

@ -16,9 +16,6 @@ icingabeat:
# Password of the user
password: "icinga"
# Defines how fast to reconnect to the API after a connection loss
retry_interval: 10s
# Skip SSL verification
skip_ssl_verify: false
@ -58,6 +55,9 @@ icingabeat:
# To disable filtering set an empty string or comment out the filter option
filter: ""
# Defines how fast to reconnect to the API on connection loss
retry_interval: 10s
statuspoller:
# Interval at which the status API is called. Set to 0 to disable polling.
interval: 60s