Default to localhost if zookeeper has no servers set (#3056)
This commit is contained in:
parent
a3307476c7
commit
742f18e8bf
|
@ -43,7 +43,7 @@ func (z *Zookeeper) Description() string {
|
||||||
// Gather reads stats from all configured servers accumulates stats
|
// Gather reads stats from all configured servers accumulates stats
|
||||||
func (z *Zookeeper) Gather(acc telegraf.Accumulator) error {
|
func (z *Zookeeper) Gather(acc telegraf.Accumulator) error {
|
||||||
if len(z.Servers) == 0 {
|
if len(z.Servers) == 0 {
|
||||||
return nil
|
z.Servers = []string{":2181"}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, serverAddress := range z.Servers {
|
for _, serverAddress := range z.Servers {
|
||||||
|
|
Loading…
Reference in New Issue