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: fix already closed connections on multiindex measurements #525

Merged
merged 1 commit into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "https://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