fix(go.d/ddsnmp): correct matching same profile multiple times (#20586)
Ilya Mashchenko committed
Jun 27, 2025 at 09:55 UTC
d1df3b6e186fdb5a2b2d6fe62528826f4fd7e6f3
2 files changed
+5
src/go/plugin/go.d/collector/snmp/ddsnmp/profile.go
+1
@@ -29,6 +29,7 @@ func FindProfiles(sysObjId string) []*Profile {
29
}
30
if m.MatchString(sysObjId) {
31
profiles = append(profiles, prof.clone())
32
+ break
33
}
34
}
35
}
src/go/plugin/go.d/collector/snmp/ddsnmp/profile_test.go
+4
@@ -50,6 +50,10 @@ func Test_FindProfiles(t *testing.T) {
50
sysObjOId: "1.3.6.1.4.1.14988.1",
51
wanProfiles: 2,
52
},
53
+ "aruba": {
54
+ sysObjOId: "1.3.6.1.4.1.14823.1.1.32",
55
+ wanProfiles: 4,
56
+ },
57
"no match": {
58
sysObjOId: "0.1.2.3",
59
wanProfiles: 0,