mirror of
https://github.com/Icinga/icingabeat.git
synced 2025-04-08 17:15:05 +02:00
Move retry_interval setting to evenstream namespace
This commit is contained in:
parent
92fe7baaa2
commit
02d6e58153
@ -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.
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user