Skip to content

Commit

Permalink
ER 2918 : Telegraf adding delay between retries for snmp availability…
Browse files Browse the repository at this point in the history
… bug (influxdata#20)
  • Loading branch information
sandeep-vunet authored Jun 7, 2022
1 parent 8292ce4 commit 2686f09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/inputs/snmp_heartbeat/snmp_heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ func (s *Snmp) Gather(acc telegraf.Accumulator) error {
rtr.Fields["snmp_error_description"] = err.Error()
rt.Rows = append(rt.Rows, rtr)
acc.AddFields(rt.Name, rtr.Fields, rtr.Tags, rt.Time)
break
} else {
fields := s.pingToURLNative(gs.Host(), acc, period)
if retries < int64(s.ProcessRetries) && fields["target_state"] == "Down" {
Expand All @@ -444,10 +445,13 @@ func (s *Snmp) Gather(acc telegraf.Accumulator) error {
}
fields["snmp_error_description"] = err.Error()
acc.AddFields(rt.Name, fields, rtr.Tags, rt.Time)
break
}
} else {
acc.AddError(fmt.Errorf("agent %s: %w", agent, err))
}
} else {
break
}
}

Expand Down

0 comments on commit 2686f09

Please sign in to comment.