Skip to content

Commit

Permalink
ER 2733 : Untracked snmp error in telegraf snmp_heartbeat (influxdata#14
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sandeep-vunet authored Jan 31, 2022
1 parent a19abd1 commit ab5cc55
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions plugins/inputs/snmp_heartbeat/snmp_heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,13 +575,16 @@ func (t Table) Build(gs snmpConnection, walk bool) (*RTable, error) {
ifv := map[string]interface{}{}

if !walk {

// This is used when fetching non-table fields. Fields configured a the top
// scope of the plugin.
// We fetch the fields directly, and add them to ifv as if the index were an
// empty string. This results in all the non-table fields sharing the same
// index, and being added on the same row.
if pkt, err := gs.Get([]string{oid}); err != nil {
pkt, err := gs.Get([]string{oid})
if pkt != nil && pkt.Error.String() != "NoError" {
return nil, fmt.Errorf(pkt.Error.String())
}
if err != nil {
if errors.Is(err, gosnmp.ErrUnknownSecurityLevel) {
return nil, fmt.Errorf("unknown security level (sec_level)")
} else if errors.Is(err, gosnmp.ErrUnknownUsername) {
Expand Down

0 comments on commit ab5cc55

Please sign in to comment.