Skip to content

Commit

Permalink
Merge pull request #680 from kongfei605/snmp_update
Browse files Browse the repository at this point in the history
snmp up synchronize with other oid
  • Loading branch information
kongfei605 authored Oct 12, 2023
2 parents 18cb77c + 75cb936 commit 9460f22
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 9460f22

Please sign in to comment.