Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix]:snmp up synchronize with other oid #680

Merged
merged 1 commit into from Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions inputs/snmp/instances.go
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