Skip to content

Commit

Permalink
snmp up synchronize with other oid
Browse files Browse the repository at this point in the history
  • Loading branch information
kongfei605 committed Oct 12, 2023
1 parent d1365aa commit 75cb936
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions inputs/snmp/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (ins *Instance) up(slist *types.SampleList, i int) {
func (ins *Instance) Gather(slist *types.SampleList) {
var wg sync.WaitGroup
for i, agent := range ins.Agents {
wg.Add(2)
wg.Add(1)
go func(i int, agent string) {
defer wg.Done()
// First is the top-level fields. We treat the fields as table prefixes with an empty index.
Expand All @@ -137,10 +137,7 @@ func (ins *Instance) Gather(slist *types.SampleList) {
if m, ok := ins.Mappings[agent]; ok {
extraTags = m
}
go func() {
defer wg.Done()
ins.up(slist, i)
}()
ins.up(slist, i)

gs, err := ins.getConnection(i)
if err != nil {
Expand Down

0 comments on commit 75cb936

Please sign in to comment.