-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
SNMP Plugin - Telegraf crash when mib file is missing #16153
Comments
Could you please add relevant config? The snmp plugin seems to run a Gather cycle and is trying to convert/format an snmp enum, as far as I can see, it doesn't do that by default/automatically. So please add at least your config for that specific The relevant log is the panic and stack trace.. |
Hi! 2024-11-06T13:08:44Z I! Starting Telegraf 1.32.0 brought to you by InfluxData the makers of InfluxDB And my snmp directory has 360 files. I was not able to isolate witch file was the missing one that generates the error. I posted an example one. Regards |
Hi! |
This is telegraf log with the new version, I don't see the messages you refer, but telegraf did not crashed. 2024-11-06T17:39:55Z I! Starting Telegraf 1.33.0-2f7f2e7e brought to you by InfluxData the makers of InfluxDB Regards! |
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf version: 1.32.0 OS: SUSE
Docker
No response
Steps to reproduce
When running telegraf with snmp pluging, if a needed mib file is missing following error occurs.
The solution is simple, putting the missing mib file into /usr/share/snmp/mibs directory or the configured one.
Expected behavior
Trap this error and log the mib file that is missing in order to make easy to locate the problem.
Actual behavior
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xcc39ed]
goroutine 1040 [running]:
github.com/sleepinggenius2/gosmi/models.Node.FormatValue(...)
/go/pkg/mod/github.com/sleepinggenius2/gosmi@v0.4.4/models/format.go:127
github.com/influxdata/telegraf/internal/snmp.(*gosmiTranslator).SnmpFormatEnum(0xc002011ac1?, {0xc00406bbc0?, 0x9f7c5c8?}, {0x7be8e00, 0xf9726a8}, 0x1)
/go/src/github.com/influxdata/telegraf/internal/snmp/translator_gosmi.go:69 +0x18d
github.com/influxdata/telegraf/internal/snmp.(*Field).Convert(0xc0062f77a0, {{0x7be8e00, 0xf9726a8}, {0xc00406bbc0, 0x28}, 0x2})
/go/src/github.com/influxdata/telegraf/internal/snmp/field.go:302 +0xf47
github.com/influxdata/telegraf/internal/snmp.Table.Build.func1({{0x7be8e00, 0xf9726a8}, {0xc00406bbc0, 0x28}, 0x2})
/go/src/github.com/influxdata/telegraf/internal/snmp/table.go:208 +0x268
github.com/gosnmp/gosnmp.(*GoSNMP).walk(0xc005f9cb00, 0xa5, {0xc002014451?, 0xc0066ecd50?}, 0xc0066ecd50)
/go/pkg/mod/github.com/gosnmp/gosnmp@v1.37.0/walk.go:152 +0xcda
github.com/gosnmp/gosnmp.(*GoSNMP).BulkWalk(...)
/go/pkg/mod/github.com/gosnmp/gosnmp@v1.37.0/gosnmp.go:590
github.com/influxdata/telegraf/internal/snmp.GosnmpWrapper.Walk({0xc00649f980?}, {0xc002014451?, 0xc00649f980?}, 0x13?)
/go/src/github.com/influxdata/telegraf/internal/snmp/wrapper.go:40 +0x45
github.com/influxdata/telegraf/internal/snmp.Table.Build({{0xc0020143c1, 0x22}, {0xc002f42e50, 0x1, 0x1}, 0x1, {0xc0001ae008, 0xc, 0xc}, {0x0, ...}, ...}, ...)
/go/src/github.com/influxdata/telegraf/internal/snmp/table.go:182 +0x4b1
github.com/influxdata/telegraf/plugins/inputs/snmp.(*Snmp).gatherTable(0xc001fb2780, {0xa07b000, 0xc006743300}, {0xa0371c0, 0xc005f9cb00}, {{0xc0020143c1, 0x22}, {0xc002f42e50, 0x1, 0x1}, ...}, ...)
/go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:134 +0x87
github.com/influxdata/telegraf/plugins/inputs/snmp.(*Snmp).Gather.func1(0x0?, {0xc0027a6701, 0x16})
/go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:122 +0x448
created by github.com/influxdata/telegraf/plugins/inputs/snmp.(*Snmp).Gather in goroutine 136
/go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:102 +0x66
Additional info
No response
The text was updated successfully, but these errors were encountered: