Skip to content

Commit

Permalink
Merge pull request #525 from toni-moreno/fix/udp_closed_mm
Browse files Browse the repository at this point in the history
fix: fix already closed connections on multiindex measurements
  • Loading branch information
toni-moreno authored Nov 15, 2022
2 parents c92f015 + dfdee63 commit d645bf2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# v0.13.1 ( 2022-11-15 )

### New Features

### Fixes

* fix #524

### breaking changes

# v0.13.0 ( 2022-02-16 )

### New Features
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"company": "Toni Inc"
},
"name": "snmpcollector",
"version": "0.12.0",
"version": "0.13.1",
"repository": {
"type": "git",
"url": "http://github.com/toni-moreno/snmpcollector.git"
Expand Down
4 changes: 3 additions & 1 deletion pkg/data/measurement/measurement.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ func (m *Measurement) InitMultiIndex() error {

// create entirely new measurement based on provided CFG
mm := New(&mcfg, m.measFilters, m.mFilters, m.Active, m.Log)
mm.SetSNMPClient(*m.snmpClient)
// use same pointer on same snmpClient as multimeas inherits connection flow from the main measurement
mm.snmpClient = m.snmpClient
err := mm.Init()
if err != nil {
return fmt.Errorf("init multi measurement %s..%s", m.ID, v.Label)
Expand Down Expand Up @@ -797,6 +798,7 @@ func (m *Measurement) loadIndexedLabels() (map[string]string, error) {
}
// needed to get data for different indexes
m.curIdxPos = m.idxPosInOID

err := m.snmpClient.Walk(m.cfg.IndexOID, setRawData)
if err != nil {
m.Log.Errorf("LOADINDEXEDLABELS - SNMP WALK error: %s", err)
Expand Down

0 comments on commit d645bf2

Please sign in to comment.