这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
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