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

Bug Fix Snmp empty metric name #9519

Merged
merged 8 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion plugins/inputs/snmp/snmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func (t *Table) Init() error {
//makes sure oid or name is set in config file
//otherwise snmp will produce metrics with an empty name
if t.Oid == "" && t.Name == "" {
return fmt.Errorf("SNMP table in config file is not named. One or both of the oid and name settings must be set")
log.Println("W! [inputs.snmp] SNMP table in config file is not named. Metrics will have no name")
}

if t.initialized {
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/snmp/snmp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func TestSnmpInit_noName_noOid(t *testing.T) {
}

err := s.init()
require.Error(t, err)
require.NoError(t, err)
}

func TestGetSNMPConnection_v2(t *testing.T) {
Expand Down