Skip to content

Commit

Permalink
Merge pull request #636 from kongfei605/snmp_update
Browse files Browse the repository at this point in the history
run snmp_up copletely even connected error
  • Loading branch information
kongfei605 committed Sep 1, 2023
2 parents 3cfc50d + 82084fb commit 26d5328
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions inputs/snmp/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@ func (ins *Instance) Gather(slist *types.SampleList) {
wg.Add(2)
go func(i int, agent string) {
defer wg.Done()
gs, err := ins.getConnection(i)
if err != nil {
log.Printf("agent %s ins: %s", agent, err)
return
}

// First is the top-level fields. We treat the fields as table prefixes with an empty index.
t := Table{
Name: ins.Name,
Expand All @@ -134,6 +128,12 @@ func (ins *Instance) Gather(slist *types.SampleList) {
defer wg.Done()
ins.up(slist, i, topTags, extraTags)
}()

gs, err := ins.getConnection(i)
if err != nil {
log.Printf("agent %s ins: %s", agent, err)
return
}
if err := ins.gatherTable(slist, gs, t, topTags, extraTags, false); err != nil {
log.Printf("agent %s ins: %s", agent, err)
}
Expand Down

0 comments on commit 26d5328

Please sign in to comment.