Skip to content

Commit

Permalink
cmd/scollector: continue snmp walk on row error
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebrandt committed Dec 11, 2015
1 parent deae8a8 commit 49772be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 5 additions & 2 deletions cmd/scollector/collectors/snmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"bosun.org/cmd/scollector/conf"
"bosun.org/metadata"
"bosun.org/opentsdb"
"bosun.org/slog"
"bosun.org/snmp"
)

Expand Down Expand Up @@ -72,7 +73,8 @@ func snmp_subtree(host, community, oid string) (map[string]interface{}, error) {
a = new(big.Int)
id, err := rows.Scan(&a)
if err != nil {
return nil, err
slog.Errorf("Error scanning oid %v on host %v: %v", oid, host, err)
continue
}
switch t := id.(type) {
case int:
Expand All @@ -83,7 +85,8 @@ func snmp_subtree(host, community, oid string) (map[string]interface{}, error) {
default:
id, err := rows.Scan(&a)
if err != nil {
return nil, err
slog.Errorf("Error scanning oid %v on host %v: %v", oid, host, err)
continue
}
switch t := id.(type) {
case int:
Expand Down
4 changes: 0 additions & 4 deletions snmp/snmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ func (b *binding) unmarshal(v interface{}) error {
convertClass(&b.Value)
_, err := asn1.Unmarshal(b.Value.FullBytes, v)
if err != nil {
if _, ok := err.(asn1.StructuralError); ok {
return fmt.Errorf("type mismatch: {class:%d tag:%d} vs. %T: %v",
b.Value.Class, b.Value.Tag, v, err)
}
return err
}
v = convertType(v)
Expand Down

0 comments on commit 49772be

Please sign in to comment.