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

cmd/scollector: continue snmp walk on row error #1514

Merged
merged 1 commit into from
Dec 11, 2015
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
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