telegraf: Telegraf 1.21.0 - go panic with SNMP plugin

Relevent telegraf.conf

Dec 17 16:38:04 hostname systemd[1]: Started The plugin-driven server agent for reporting metrics into InfluxDB.
Dec 17 16:38:04 hostname telegraf[306402]: 2021-12-17T15:38:04Z I! Starting Telegraf 1.21.1
Dec 17 16:38:04 hostname telegraf[306402]: 2021-12-17T15:38:04Z I! Loaded inputs: cpu disk internal mem net ping snmp (352x) swap
Dec 17 16:38:04 hostname telegraf[306402]: 2021-12-17T15:38:04Z I! Loaded aggregators:
Dec 17 16:38:04 hostname telegraf[306402]: 2021-12-17T15:38:04Z I! Loaded processors: converter
Dec 17 16:38:04 hostname telegraf[306402]: 2021-12-17T15:38:04Z I! Loaded outputs: influxdb_v2 (2x)
Dec 17 16:38:04 hostname telegraf[306402]: 2021-12-17T15:38:04Z I! Tags enabled: host=s
Dec 17 16:38:04 hostname telegraf[306402]: 2021-12-17T15:38:04Z I! [agent] Config: Interval:2m0s, Quiet:false, Hostname:"", Flush Interval:10s
Dec 17 16:38:06 hostname telegraf[306402]: panic: runtime error: index out of range [1] with length 1
Dec 17 16:38:06 hostname telegraf[306402]: goroutine 1 [running]:
Dec 17 16:38:06 hostname telegraf[306402]: github.com/influxdata/telegraf/internal/snmp.SnmpTranslateCall({0xc00158ca81, 0x27})
Dec 17 16:38:06 hostname telegraf[306402]:         /go/src/github.com/influxdata/telegraf/internal/snmp/translate.go:153 +0xbfd
Dec 17 16:38:06 hostname telegraf[306402]: github.com/influxdata/telegraf/plugins/inputs/snmp.SnmpTranslate({0xc00158ca81, 0x27})
Dec 17 16:38:06 hostname telegraf[306402]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:877 +0x170
Dec 17 16:38:06 hostname telegraf[306402]: github.com/influxdata/telegraf/plugins/inputs/snmp.(*Field).init(0xc000766708)
Dec 17 16:38:06 hostname telegraf[306402]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:263 +0x73
Dec 17 16:38:06 hostname telegraf[306402]: github.com/influxdata/telegraf/plugins/inputs/snmp.(*Table).Init(0xc0016ede00)
Dec 17 16:38:06 hostname telegraf[306402]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:169 +0xd8
Dec 17 16:38:06 hostname telegraf[306402]: github.com/influxdata/telegraf/plugins/inputs/snmp.(*Snmp).Init(0xc0009f7340)
Dec 17 16:38:06 hostname telegraf[306402]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:110 +0x127
Dec 17 16:38:06 hostname telegraf[306402]: github.com/influxdata/telegraf/models.(*RunningInput).Init(0xc000e4b758)
Dec 17 16:38:06 hostname telegraf[306402]:         /go/src/github.com/influxdata/telegraf/models/running_input.go:82 +0x35
Dec 17 16:38:06 hostname telegraf[306402]: github.com/influxdata/telegraf/agent.(*Agent).initPlugins(0xc000184ba8)
Dec 17 16:38:06 hostname telegraf[306402]:         /go/src/github.com/influxdata/telegraf/agent/agent.go:189 +0x96
Dec 17 16:38:06 hostname telegraf[306402]: github.com/influxdata/telegraf/agent.(*Agent).Run(0xc000184ba8, {0x57e5688, 0xc000acc380})
Dec 17 16:38:06 hostname telegraf[306402]:         /go/src/github.com/influxdata/telegraf/agent/agent.go:105 +0x185
Dec 17 16:38:06 hostname telegraf[306402]: main.runAgent({0x57e5688, 0xc000acc380}, {0x837a278, 0x0, 0x0}, {0x837a278, 0x0, 0x0})
Dec 17 16:38:06 hostname telegraf[306402]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:312 +0xc57
Dec 17 16:38:06 hostname telegraf[306402]: main.reloadLoop({0x837a278, 0x0, 0x0}, {0x837a278, 0x0, 0x0})
Dec 17 16:38:06 hostname telegraf[306402]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:147 +0x28a
Dec 17 16:38:06 hostname telegraf[306402]: main.run(...)
Dec 17 16:38:06 hostname telegraf[306402]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf_posix.go:8
Dec 17 16:38:06 hostname telegraf[306402]: main.main()
Dec 17 16:38:06 hostname telegraf[306402]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:485 +0xa9a
Dec 17 16:38:06 hostname systemd[1]: telegraf.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 17 16:38:06 hostname systemd[1]: telegraf.service: Failed with result 'exit-code'.
Dec 17 16:38:07 hostname systemd[1]: telegraf.service: Service RestartSec=100ms expired, scheduling restart.
Dec 17 16:38:07 hostname systemd[1]: telegraf.service: Scheduled restart job, restart counter is at 26.
Dec 17 16:38:07 hostname systemd[1]: Stopped The plugin-driven server agent for reporting metrics into InfluxDB.

System info

Telegraf 1.21.1

Docker

No response

Steps to reproduce

  1. After the agent restarted it restarts every 100ms because of the error “panic: runtime error: index out of range [1] with length 1”
  2. rollback to 1.21.0 does not fix the issue
  3. rollback to 1.20.4 fixes the issue

Expected behavior

to work like 1.20.4

Actual behavior

crashes

Additional info

Not sure if I have a specific snmp MIB file that causes this, I cannot see any reference in the trace what causes it besides snmptranslate

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 44 (19 by maintainers)

Most upvoted comments

It would be nice if this were left open til the release, so that we would get notifications when the release happens.

FWIW this issue is still VERY much a problem - I’ve got issues across a wide MIB list using v1.21.3-1

The current fix (for me, and others) was downgrading to 1.20.4-1 on my Ubuntu machine via:

curl -LO -C - https://dl.influxdata.com/telegraf/releases/telegraf_1.20.4-1_amd64.deb sudo dpkg -i telegraf_1.20.4-1_amd64.deb

Be sure to set a hold on telegraf too!

sudo apt-mark hold telegraf

Once I downgraded, my data was once again making it to Influx & I was able to visualize my data in Grafana again

v1.21.2 which contains numerous SNMP fixes is now out. Thanks!

Looks like you might not have the repository added for telegraf?

Easiest way would be to download the .deb and install via dpkg.

wget https://dl.influxdata.com/telegraf/releases/telegraf_1.20.4-1_amd64.deb
dpkg -i telegraf_1.20.4-1_amd64.deb

If you would prefer to manage via apt make sure you add the source. https://docs.influxdata.com/telegraf/v1.21/introduction/installation/#ubuntu--debian

I ran your config with your mibs. I had to comment out HOST-RESOURCES-MIB as that was not included. I ran on this pr as it is what is going to fix the panic. And I am getting performing get on field sysName: marshal: marshalPDU: unable to marshal varbind list: unable to marshal OID: Invalid object identifier. Which is an issue with gosnmp and can be tracked via this ticket. Thank you for you patience with all of these kinks while we get switched over to gosmi!

I have tried to implement what the owner of the library recommended. If you wouldn’t mind testing this draft pr and giving some feedback, it would be greatly appreciated 😃

We have this panic on a similar mib, unfortunately, it is an issue in the new gosmi library we are using to parse mibs. I logged an issue with the library here, if you would like to follow it. I will also keep you updated on the status. Thank you for your continued support!

I don’t know if this is the same issue, but I see similiarities and thought i would post it here. Let me know though if I should post it as a new issue, or if you would like more information. This same telegraf.conf has been used for around a year without any issue with the previous telegraf versions. Thanks for you help and working on a great product.

Telegraph installation on a raspberryPi running Ubuntu.
telegraf/unknown,now 1.21.1-1 arm64 [installed]

Relevant logs:

Dec 17 14:58:53 hostname systemd[1]: Started The plugin-driven server agent for reporting metrics into InfluxDB.
Dec 17 14:58:53 hostname telegraf[3575]: 2021-12-17T21:58:53Z I! Starting Telegraf 1.21.1
Dec 17 14:58:53 hostname telegraf[3575]: 2021-12-17T21:58:53Z I! Loaded inputs: cpu disk diskio file kernel mem net netstat processes snmp swap system
Dec 17 14:58:53 hostname telegraf[3575]: 2021-12-17T21:58:53Z I! Loaded aggregators:
Dec 17 14:58:53 hostname telegraf[3575]: 2021-12-17T21:58:53Z I! Loaded processors:
Dec 17 14:58:53 hostname telegraf[3575]: 2021-12-17T21:58:53Z I! Loaded outputs: influxdb
Dec 17 14:58:53 hostname telegraf[3575]: 2021-12-17T21:58:53Z I! Tags enabled: host=hostname
Dec 17 14:58:53 hostname telegraf[3575]: 2021-12-17T21:58:53Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"hostname", Flush Interval:10s
Dec 17 14:58:56 hostname telegraf[3575]: Parse module: /usr/share/snmp/mibs/site/miblist.txt:1:12: no match found for .
Dec 17 14:58:56 hostname telegraf[3575]: 2021-12-17T21:58:56Z W! [inputs.snmp] Could not load module at miblist.txt
Dec 17 14:59:03 hostname telegraf[3575]: Parse module: /var/lib/snmp/mibs/ietf/DPI20-MIB:9:4: unexpected "ibm" (expected ";")
Dec 17 14:59:03 hostname telegraf[3575]: 2021-12-17T21:59:03Z W! [inputs.snmp] Could not load module at DPI20-MIB
Dec 17 14:59:07 hostname telegraf[3575]: Parse module: /var/lib/snmp/mibs/ietf/HPR-MIB:494:30: unexpected "HprRtpCounter" (expected "}")
Dec 17 14:59:07 hostname telegraf[3575]: 2021-12-17T21:59:07Z W! [inputs.snmp] Could not load module at HPR-MIB
Dec 17 14:59:15 hostname telegraf[3575]: Parse module: /var/lib/snmp/mibs/ietf/SNMPv2-PDU:73:1: unexpected "max-bindings" (expected "END")
Dec 17 14:59:15 hostname telegraf[3575]: 2021-12-17T21:59:15Z W! [inputs.snmp] Could not load module at SNMPv2-PDU
Dec 17 14:59:17 hostname telegraf[3575]: Parse module: /var/lib/snmp/mibs/ietf/TCPIPX-MIB:63:12: unexpected "tcpIpxConnLocalPort" (expected "}")
Dec 17 14:59:17 hostname telegraf[3575]: 2021-12-17T21:59:17Z W! [inputs.snmp] Could not load module at TCPIPX-MIB
Dec 17 14:59:18 hostname telegraf[3575]: panic: strconv.ParseUint: parsing "": invalid syntax
Dec 17 14:59:18 hostname telegraf[3575]: goroutine 1 [running]:
Dec 17 14:59:18 hostname telegraf[3575]: github.com/sleepinggenius2/gosmi/types.OidMustFromString(...)
Dec 17 14:59:18 hostname telegraf[3575]:         /go/pkg/mod/github.com/sleepinggenius2/gosmi@v0.4.3/types/oid.go:91
Dec 17 14:59:18 hostname telegraf[3575]: github.com/influxdata/telegraf/internal/snmp.GetIndex({0x4fab394, 0x1}, {0x4000b95128, 0xe})
Dec 17 14:59:18 hostname telegraf[3575]:         /go/src/github.com/influxdata/telegraf/internal/snmp/translate.go:126 +0x348
Dec 17 14:59:18 hostname telegraf[3575]: github.com/influxdata/telegraf/plugins/inputs/snmp.snmpTableCall({0x4000e52641, 0x15})
Dec 17 14:59:18 hostname telegraf[3575]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:837 +0xcc
Dec 17 14:59:18 hostname telegraf[3575]: github.com/influxdata/telegraf/plugins/inputs/snmp.snmpTable({0x4000e52641, 0x15})
Dec 17 14:59:18 hostname telegraf[3575]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:820 +0x1b0
Dec 17 14:59:18 hostname telegraf[3575]: github.com/influxdata/telegraf/plugins/inputs/snmp.(*Table).initBuild(0x4000a00860)
Dec 17 14:59:18 hostname telegraf[3575]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:192 +0x40
Dec 17 14:59:18 hostname telegraf[3575]: github.com/influxdata/telegraf/plugins/inputs/snmp.(*Table).Init(0x4000a00860)
Dec 17 14:59:18 hostname telegraf[3575]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:162 +0x7c
Dec 17 14:59:18 hostname telegraf[3575]: github.com/influxdata/telegraf/plugins/inputs/snmp.(*Snmp).Init(0x400038c000)
Dec 17 14:59:18 hostname telegraf[3575]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:110 +0x118
Dec 17 14:59:18 hostname telegraf[3575]: github.com/influxdata/telegraf/models.(*RunningInput).Init(0x4000e5d400)
Dec 17 14:59:18 hostname telegraf[3575]:         /go/src/github.com/influxdata/telegraf/models/running_input.go:82 +0x58
Dec 17 14:59:18 hostname telegraf[3575]: github.com/influxdata/telegraf/agent.(*Agent).initPlugins(0x400011c400)
Dec 17 14:59:18 hostname telegraf[3575]:         /go/src/github.com/influxdata/telegraf/agent/agent.go:189 +0x74
Dec 17 14:59:18 hostname telegraf[3575]: github.com/influxdata/telegraf/agent.(*Agent).Run(0x400011c400, {0x50f04e8, 0x40001bbe00})
Dec 17 14:59:18 hostname telegraf[3575]:         /go/src/github.com/influxdata/telegraf/agent/agent.go:105 +0x140
Dec 17 14:59:18 hostname telegraf[3575]: main.runAgent({0x50f04e8, 0x40001bbe00}, {0x7b610f8, 0x0, 0x0}, {0x7b610f8, 0x0, 0x0})
Dec 17 14:59:18 hostname telegraf[3575]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:312 +0xcf0
Dec 17 14:59:18 hostname telegraf[3575]: main.reloadLoop({0x7b610f8, 0x0, 0x0}, {0x7b610f8, 0x0, 0x0})
Dec 17 14:59:18 hostname telegraf[3575]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:147 +0x220
Dec 17 14:59:18 hostname telegraf[3575]: main.run(...)
Dec 17 14:59:18 hostname telegraf[3575]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf_posix.go:8
Dec 17 14:59:18 hostname telegraf[3575]: main.main()
Dec 17 14:59:18 hostname telegraf[3575]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:485 +0xcb8
Dec 17 14:59:18 hostname systemd[1]: telegraf.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 17 14:59:18 hostname systemd[1]: telegraf.service: Failed with result 'exit-code'.
Dec 17 14:59:18 hostname systemd[1]: telegraf.service: Scheduled restart job, restart counter is at 6.
Dec 17 14:59:18 hostname systemd[1]: Stopped The plugin-driven server agent for reporting metrics into InfluxDB.
Dec 17 14:59:18 hostname systemd[1]: Started The plugin-driven server agent for reporting metrics into InfluxDB.
Dec 17 14:59:18 hostname telegraf[3699]: 2021-12-17T21:59:18Z I! Starting Telegraf 1.21.1
Dec 17 14:59:18 hostname telegraf[3699]: 2021-12-17T21:59:18Z I! Loaded inputs: cpu disk diskio file kernel mem net netstat processes snmp swap system
Dec 17 14:59:18 hostname telegraf[3699]: 2021-12-17T21:59:18Z I! Loaded aggregators:
Dec 17 14:59:18 hostname telegraf[3699]: 2021-12-17T21:59:18Z I! Loaded processors:
Dec 17 14:59:18 hostname telegraf[3699]: 2021-12-17T21:59:18Z I! Loaded outputs: influxdb
Dec 17 14:59:18 hostname telegraf[3699]: 2021-12-17T21:59:18Z I! Tags enabled: host=hostname
Dec 17 14:59:18 hostname telegraf[3699]: 2021-12-17T21:59:18Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"hostname", Flush Interval:10s
Dec 17 14:59:21 hostname telegraf[3699]: Parse module: /usr/share/snmp/mibs/site/miblist.txt:1:12: no match found for .
Dec 17 14:59:21 hostname telegraf[3699]: 2021-12-17T21:59:21Z W! [inputs.snmp] Could not load module at miblist.txt
Dec 17 14:59:28 hostname telegraf[3699]: Parse module: /var/lib/snmp/mibs/ietf/DPI20-MIB:9:4: unexpected "ibm" (expected ";")
Dec 17 14:59:28 hostname telegraf[3699]: 2021-12-17T21:59:28Z W! [inputs.snmp] Could not load module at DPI20-MIB
Dec 17 14:59:31 hostname telegraf[3699]: Parse module: /var/lib/snmp/mibs/ietf/HPR-MIB:494:30: unexpected "HprRtpCounter" (expected "}")
Dec 17 14:59:31 hostname telegraf[3699]: 2021-12-17T21:59:31Z W! [inputs.snmp] Could not load module at HPR-MIB
Dec 17 14:59:39 hostname telegraf[3699]: Parse module: /var/lib/snmp/mibs/ietf/SNMPv2-PDU:73:1: unexpected "max-bindings" (expected "END")
Dec 17 14:59:39 hostname telegraf[3699]: 2021-12-17T21:59:39Z W! [inputs.snmp] Could not load module at SNMPv2-PDU
Dec 17 14:59:40 hostname telegraf[3699]: Parse module: /var/lib/snmp/mibs/ietf/TCPIPX-MIB:63:12: unexpected "tcpIpxConnLocalPort" (expected "}")
Dec 17 14:59:40 hostname telegraf[3699]: 2021-12-17T21:59:40Z W! [inputs.snmp] Could not load module at TCPIPX-MIB
Dec 17 14:59:41 hostname telegraf[3699]: panic: strconv.ParseUint: parsing "": invalid syntax
Dec 17 14:59:41 hostname telegraf[3699]: goroutine 1 [running]:
Dec 17 14:59:41 hostname telegraf[3699]: github.com/sleepinggenius2/gosmi/types.OidMustFromString(...)
Dec 17 14:59:41 hostname telegraf[3699]:         /go/pkg/mod/github.com/sleepinggenius2/gosmi@v0.4.3/types/oid.go:91
Dec 17 14:59:41 hostname telegraf[3699]: github.com/influxdata/telegraf/internal/snmp.GetIndex({0x4fab394, 0x1}, {0x400405f128, 0xe})
Dec 17 14:59:41 hostname telegraf[3699]:         /go/src/github.com/influxdata/telegraf/internal/snmp/translate.go:126 +0x348
Dec 17 14:59:41 hostname telegraf[3699]: github.com/influxdata/telegraf/plugins/inputs/snmp.snmpTableCall({0x4000ace6a1, 0x15})
Dec 17 14:59:41 hostname telegraf[3699]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:837 +0xcc
Dec 17 14:59:41 hostname telegraf[3699]: github.com/influxdata/telegraf/plugins/inputs/snmp.snmpTable({0x4000ace6a1, 0x15})
Dec 17 14:59:41 hostname telegraf[3699]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:820 +0x1b0
Dec 17 14:59:41 hostname telegraf[3699]: github.com/influxdata/telegraf/plugins/inputs/snmp.(*Table).initBuild(0x4000e78060)
Dec 17 14:59:41 hostname telegraf[3699]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:192 +0x40
Dec 17 14:59:41 hostname telegraf[3699]: github.com/influxdata/telegraf/plugins/inputs/snmp.(*Table).Init(0x4000e78060)
Dec 17 14:59:41 hostname telegraf[3699]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:162 +0x7c
Dec 17 14:59:41 hostname telegraf[3699]: github.com/influxdata/telegraf/plugins/inputs/snmp.(*Snmp).Init(0x40001d1b80)
Dec 17 14:59:41 hostname telegraf[3699]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:110 +0x118
Dec 17 14:59:41 hostname telegraf[3699]: github.com/influxdata/telegraf/models.(*RunningInput).Init(0x4000adeaa0)
Dec 17 14:59:41 hostname telegraf[3699]:         /go/src/github.com/influxdata/telegraf/models/running_input.go:82 +0x58
Dec 17 14:59:41 hostname telegraf[3699]: github.com/influxdata/telegraf/agent.(*Agent).initPlugins(0x400000ebf0)
Dec 17 14:59:41 hostname telegraf[3699]:         /go/src/github.com/influxdata/telegraf/agent/agent.go:189 +0x74
Dec 17 14:59:41 hostname telegraf[3699]: github.com/influxdata/telegraf/agent.(*Agent).Run(0x400000ebf0, {0x50f04e8, 0x40007535c0})
Dec 17 14:59:41 hostname telegraf[3699]:         /go/src/github.com/influxdata/telegraf/agent/agent.go:105 +0x140
Dec 17 14:59:41 hostname telegraf[3699]: main.runAgent({0x50f04e8, 0x40007535c0}, {0x7b610f8, 0x0, 0x0}, {0x7b610f8, 0x0, 0x0})
Dec 17 14:59:41 hostname telegraf[3699]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:312 +0xcf0
Dec 17 14:59:41 hostname telegraf[3699]: main.reloadLoop({0x7b610f8, 0x0, 0x0}, {0x7b610f8, 0x0, 0x0})
Dec 17 14:59:41 hostname telegraf[3699]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:147 +0x220
Dec 17 14:59:41 hostname telegraf[3699]: main.run(...)
Dec 17 14:59:41 hostname telegraf[3699]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf_posix.go:8
Dec 17 14:59:41 hostname telegraf[3699]: main.main()
Dec 17 14:59:41 hostname telegraf[3699]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:485 +0xcb8
Dec 17 14:59:41 hostname systemd[1]: telegraf.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 17 14:59:41 hostname systemd[1]: telegraf.service: Failed with result 'exit-code'.
Dec 17 14:59:42 hostname systemd[1]: telegraf.service: Scheduled restart job, restart counter is at 7.
Dec 17 14:59:42 hostname systemd[1]: Stopped The plugin-driven server agent for reporting metrics into InfluxDB.
Dec 17 14:59:42 hostname systemd[1]: Started The plugin-driven server agent for reporting metrics into InfluxDB.
Dec 17 14:59:42 hostname telegraf[3819]: 2021-12-17T21:59:42Z I! Starting Telegraf 1.21.1
Dec 17 14:59:42 hostname telegraf[3819]: 2021-12-17T21:59:42Z I! Loaded inputs: cpu disk diskio file kernel mem net netstat processes snmp swap system
Dec 17 14:59:42 hostname telegraf[3819]: 2021-12-17T21:59:42Z I! Loaded aggregators:
Dec 17 14:59:42 hostname telegraf[3819]: 2021-12-17T21:59:42Z I! Loaded processors:
Dec 17 14:59:42 hostname telegraf[3819]: 2021-12-17T21:59:42Z I! Loaded outputs: influxdb
Dec 17 14:59:42 hostname telegraf[3819]: 2021-12-17T21:59:42Z I! Tags enabled: host=hostname
Dec 17 14:59:42 hostname telegraf[3819]: 2021-12-17T21:59:42Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:"hostname", Flush Interval:10s
Dec 17 14:59:45 hostname telegraf[3819]: Parse module: /usr/share/snmp/mibs/site/miblist.txt:1:12: no match found for .
Dec 17 14:59:45 hostname telegraf[3819]: 2021-12-17T21:59:45Z W! [inputs.snmp] Could not load module at miblist.txt
Dec 17 14:59:52 hostname telegraf[3819]: Parse module: /var/lib/snmp/mibs/ietf/DPI20-MIB:9:4: unexpected "ibm" (expected ";")
Dec 17 14:59:52 hostname telegraf[3819]: 2021-12-17T21:59:52Z W! [inputs.snmp] Could not load module at DPI20-MIB
Dec 17 14:59:55 hostname telegraf[3819]: Parse module: /var/lib/snmp/mibs/ietf/HPR-MIB:494:30: unexpected "HprRtpCounter" (expected "}")
Dec 17 14:59:55 hostname telegraf[3819]: 2021-12-17T21:59:55Z W! [inputs.snmp] Could not load module at HPR-MIB
Dec 17 14:59:57 hostname systemd[1]: Stopping The plugin-driven server agent for reporting metrics into InfluxDB...
Dec 17 15:00:03 hostname telegraf[3819]: Parse module: /var/lib/snmp/mibs/ietf/SNMPv2-PDU:73:1: unexpected "max-bindings" (expected "END")
Dec 17 15:00:03 hostname telegraf[3819]: 2021-12-17T22:00:03Z W! [inputs.snmp] Could not load module at SNMPv2-PDU
Dec 17 15:00:04 hostname telegraf[3819]: Parse module: /var/lib/snmp/mibs/ietf/TCPIPX-MIB:63:12: unexpected "tcpIpxConnLocalPort" (expected "}")
Dec 17 15:00:04 hostname telegraf[3819]: 2021-12-17T22:00:04Z W! [inputs.snmp] Could not load module at TCPIPX-MIB
Dec 17 15:00:06 hostname telegraf[3819]: panic: strconv.ParseUint: parsing "": invalid syntax
Dec 17 15:00:06 hostname telegraf[3819]: goroutine 1 [running]:
Dec 17 15:00:06 hostname telegraf[3819]: github.com/sleepinggenius2/gosmi/types.OidMustFromString(...)
Dec 17 15:00:06 hostname telegraf[3819]:         /go/pkg/mod/github.com/sleepinggenius2/gosmi@v0.4.3/types/oid.go:91
Dec 17 15:00:06 hostname telegraf[3819]: github.com/influxdata/telegraf/internal/snmp.GetIndex({0x4fab394, 0x1}, {0x40048bb128, 0xe})
Dec 17 15:00:06 hostname telegraf[3819]:         /go/src/github.com/influxdata/telegraf/internal/snmp/translate.go:126 +0x348
Dec 17 15:00:06 hostname telegraf[3819]: github.com/influxdata/telegraf/plugins/inputs/snmp.snmpTableCall({0x4000b76561, 0x15})
Dec 17 15:00:06 hostname telegraf[3819]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:837 +0xcc
Dec 17 15:00:06 hostname telegraf[3819]: github.com/influxdata/telegraf/plugins/inputs/snmp.snmpTable({0x4000b76561, 0x15})
Dec 17 15:00:06 hostname telegraf[3819]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:820 +0x1b0
Dec 17 15:00:06 hostname telegraf[3819]: github.com/influxdata/telegraf/plugins/inputs/snmp.(*Table).initBuild(0x400057c460)
Dec 17 15:00:06 hostname telegraf[3819]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:192 +0x40
Dec 17 15:00:06 hostname telegraf[3819]: github.com/influxdata/telegraf/plugins/inputs/snmp.(*Table).Init(0x400057c460)
Dec 17 15:00:06 hostname telegraf[3819]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:162 +0x7c
Dec 17 15:00:06 hostname telegraf[3819]: github.com/influxdata/telegraf/plugins/inputs/snmp.(*Snmp).Init(0x400033edc0)
Dec 17 15:00:06 hostname telegraf[3819]:         /go/src/github.com/influxdata/telegraf/plugins/inputs/snmp/snmp.go:110 +0x118
Dec 17 15:00:06 hostname telegraf[3819]: github.com/influxdata/telegraf/models.(*RunningInput).Init(0x4000b10eb0)
Dec 17 15:00:06 hostname telegraf[3819]:         /go/src/github.com/influxdata/telegraf/models/running_input.go:82 +0x58
Dec 17 15:00:06 hostname telegraf[3819]: github.com/influxdata/telegraf/agent.(*Agent).initPlugins(0x400019e588)
Dec 17 15:00:06 hostname telegraf[3819]:         /go/src/github.com/influxdata/telegraf/agent/agent.go:189 +0x74
Dec 17 15:00:06 hostname telegraf[3819]: github.com/influxdata/telegraf/agent.(*Agent).Run(0x400019e588, {0x50f04e8, 0x40000d8740})
Dec 17 15:00:06 hostname telegraf[3819]:         /go/src/github.com/influxdata/telegraf/agent/agent.go:105 +0x140
Dec 17 15:00:06 hostname telegraf[3819]: main.runAgent({0x50f04e8, 0x40000d8740}, {0x7b610f8, 0x0, 0x0}, {0x7b610f8, 0x0, 0x0})
Dec 17 15:00:06 hostname telegraf[3819]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:312 +0xcf0
Dec 17 15:00:06 hostname telegraf[3819]: main.reloadLoop({0x7b610f8, 0x0, 0x0}, {0x7b610f8, 0x0, 0x0})
Dec 17 15:00:06 hostname telegraf[3819]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:147 +0x220
Dec 17 15:00:06 hostname telegraf[3819]: main.run(...)
Dec 17 15:00:06 hostname telegraf[3819]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf_posix.go:8
Dec 17 15:00:06 hostname telegraf[3819]: main.main()
Dec 17 15:00:06 hostname telegraf[3819]:         /go/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:485 +0xcb8
Dec 17 15:00:06 hostname systemd[1]: telegraf.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 17 15:00:06 hostname systemd[1]: telegraf.service: Failed with result 'exit-code'.
Dec 17 15:00:06 hostname systemd[1]: Stopped The plugin-driven server agent for reporting metrics into InfluxDB.
lines 847-1002/1002 (END)

I’m only using the snmp plugin to monitor a ubiquity EdgeRouterX, and here are the relevant log:

##
## EdgeRouter devices
##
 [[inputs.snmp]]
   # List of agents to poll
   agents = [ "192.168.x.x"]
   # Polling interval
   interval = "60s"
   # Timeout for each SNMP query.
   timeout = "5s"
   # Number of retries to attempt within timeout.
   retries = 3
   # SNMP version, values can be 1, 2, or 3
   version = 2
   # SNMP community string.
   community = "home-erx"
   # The GETBULK max-repetitions parameter
   max_repetitions = 50
   # Measurement name
   name = "snmp.EdgeOS"
   ##
   ## Exclusions
   ##
   # Don't want these columns from UCD-SNMP-MIB::laTable
   fielddrop = [ "laErrorFlag", "laErrMessage" ]
   # Don't want these rows from UCD-DISKIO-MIB::diskIOTable
   [inputs.snmp.tagdrop]
     diskIODevice = [ "loop*", "ram*" ]
   ##
   ## System details
   ##
   #  System name (hostname)
   [[inputs.snmp.field]]
     name = "sysName"
     oid = "SNMPv2-MIB::sysName.0"
     is_tag = true
   #  System vendor OID
   [[inputs.snmp.field]]
     name = "sysObjectID"
     oid = "SNMPv2-MIB::sysObjectID.0"
   #  System description
   [[inputs.snmp.field]]
     name = "sysDescr"
     oid = "SNMPv2-MIB::sysDescr.0"
   #  System contact
   [[inputs.snmp.field]]
     name = "sysContact"
     oid = "SNMPv2-MIB::sysContact.0"
   #  System location
   [[inputs.snmp.field]]
     name = "sysLocation"
     oid = "SNMPv2-MIB::sysLocation.0"
   ##
   ## Host/System Resources
   ##
   #  System uptime
   [[inputs.snmp.field]]
     name = "sysUpTime"
     oid = "HOST-RESOURCES-MIB::hrSystemUptime.0"
   #  Number of user sessions
   [[inputs.snmp.field]]
     name = "hrSystemNumUsers"
     oid = "HOST-RESOURCES-MIB::hrSystemNumUsers.0"
   #  Number of process contexts
   [[inputs.snmp.field]]
     name = "hrSystemProcesses"
     oid = "HOST-RESOURCES-MIB::hrSystemProcesses.0"
   #  Device Listing
   [[inputs.snmp.table]]
     oid = "HOST-RESOURCES-MIB::hrDeviceTable"
     [[inputs.snmp.table.field]]
       oid = "HOST-RESOURCES-MIB::hrDeviceIndex"
       is_tag = true
   ##
   ## Context Switches & Interrupts
   ##
   #  Number of interrupts processed
   [[inputs.snmp.field]]
     name = "ssRawInterrupts"
     oid = "UCD-SNMP-MIB::ssRawInterrupts.0"
   #  Number of context switches
   [[inputs.snmp.field]]
     name = "ssRawContexts"
     oid = "UCD-SNMP-MIB::ssRawContexts.0"
   ##
   ## Host performance metrics
   ##
   #  System Load Average
   [[inputs.snmp.table]]
     oid = "UCD-SNMP-MIB::laTable"
     [[inputs.snmp.table.field]]
       oid = "UCD-SNMP-MIB::laNames"
       is_tag = true
   ##
   ## CPU inventory
   ##
   #  Processor listing
   [[inputs.snmp.table]]
     index_as_tag = true
     oid = "HOST-RESOURCES-MIB::hrProcessorTable"
   ##
   ## CPU utilization
   ##
   #  Number of 'ticks' spent on user-level
   [[inputs.snmp.field]]
     name = "ssCpuRawUser"
     oid = "UCD-SNMP-MIB::ssCpuRawUser.0"
   #  Number of 'ticks' spent on reduced-priority
   [[inputs.snmp.field]]
     name = "ssCpuRawNice"
     oid = "UCD-SNMP-MIB::ssCpuRawNice.0"
   #  Number of 'ticks' spent on system-level
   [[inputs.snmp.field]]
     name = "ssCpuRawSystem"
     oid = "UCD-SNMP-MIB::ssCpuRawSystem.0"
   #  Number of 'ticks' spent idle
   [[inputs.snmp.field]]
     name = "ssCpuRawIdle"
     oid = "UCD-SNMP-MIB::ssCpuRawIdle.0"
   #  Number of 'ticks' spent waiting on I/O
   [[inputs.snmp.field]]
     name = "ssCpuRawWait"
     oid = "UCD-SNMP-MIB::ssCpuRawWait.0"
   #  Number of 'ticks' spent in kernel
   [[inputs.snmp.field]]
     name = "ssCpuRawKernel"
     oid = "UCD-SNMP-MIB::ssCpuRawKernel.0"
   #  Number of 'ticks' spent on hardware interrupts
   [[inputs.snmp.field]]
     name = "ssCpuRawInterrupt"
     oid = "UCD-SNMP-MIB::ssCpuRawInterrupt.0"
   #  Number of 'ticks' spent on software interrupts
   [[inputs.snmp.field]]
     name = "ssCpuRawSoftIRQ"
     oid = "UCD-SNMP-MIB::ssCpuRawSoftIRQ.0"
   ##
   ## System Memory (physical/virtual)
   ##
   #  Size of phsyical memory (RAM)
   [[inputs.snmp.field]]
     name = "hrMemorySize"
     oid = "HOST-RESOURCES-MIB::hrMemorySize.0"
   #  Size of real/phys mem installed
   [[inputs.snmp.field]]
     name = "memTotalReal"
     oid = "UCD-SNMP-MIB::memTotalReal.0"
   #  Size of real/phys mem unused/avail
   [[inputs.snmp.field]]
     name = "memAvailReal"
     oid = "UCD-SNMP-MIB::memAvailReal.0"
   #  Total amount of mem unused/avail
   [[inputs.snmp.field]]
     name = "memTotalFree"
     oid = "UCD-SNMP-MIB::memTotalFree.0"
   #  Size of mem used as shared memory
   [[inputs.snmp.field]]
     name = "memShared"
     oid = "UCD-SNMP-MIB::memShared.0"
   #  Size of mem used for buffers
   [[inputs.snmp.field]]
     name = "memBuffer"
     oid = "UCD-SNMP-MIB::memBuffer.0"
   #  Size of mem used for cache
   [[inputs.snmp.field]]
     name = "memCached"
     oid = "UCD-SNMP-MIB::memCached.0"
   ##
   ## Block (Disk) performance
   ##
   #  System-wide blocks written
   [[inputs.snmp.field]]
     name = "ssIORawSent"
     oid = "UCD-SNMP-MIB::ssIORawSent.0"
   #  Number of blocks read
   [[inputs.snmp.field]]
     name = "ssIORawReceived"
     oid = "UCD-SNMP-MIB::ssIORawReceived.0"
   #  Per-device (disk) performance
   [[inputs.snmp.table]]
     oid = "UCD-DISKIO-MIB::diskIOTable"
     [[inputs.snmp.table.field]]
       oid = "UCD-DISKIO-MIB::diskIODevice"
       is_tag = true
   ##
   ## Disk/Partition/Filesystem inventory & usage
   ##
   #  Storage listing
   [[inputs.snmp.table]]
     oid = "HOST-RESOURCES-MIB::hrStorageTable"
     [[inputs.snmp.table.field]]
       oid = "HOST-RESOURCES-MIB::hrStorageDescr"
       is_tag = true
   ##
   ## Interface metrics
   ##
   #  Per-interface traffic, errors, drops
   [[inputs.snmp.table]]
     oid = "IF-MIB::ifTable"
     [[inputs.snmp.table.field]]
       oid = "IF-MIB::ifName"
       is_tag = true
   #  Per-interface high-capacity (HC) counters
   [[inputs.snmp.table]]
     oid = "IF-MIB::ifXTable"
     [[inputs.snmp.table.field]]
       oid = "IF-MIB::ifName"
       is_tag = true
   ##
   ## IP metrics
   ##
   #  System-wide IP metrics
   [[inputs.snmp.table]]
     index_as_tag = true
     oid = "IP-MIB::ipSystemStatsTable"
   ##
   ## ICMP Metrics
   ##
   #  ICMP statistics
   [[inputs.snmp.table]]
     index_as_tag = true
     oid = "IP-MIB::icmpStatsTable"
   #  ICMP per-type statistics
   [[inputs.snmp.table]]
     index_as_tag = true
     oid = "IP-MIB::icmpMsgStatsTable"
   ##
   ## UDP statistics
   ##
   #  Datagrams delivered to app
   [[inputs.snmp.field]]
     name = "udpInDatagrams"
     oid = "UDP-MIB::udpInDatagrams.0"
   #  Datagrams received with no app
   [[inputs.snmp.field]]
     name = "udpNoPorts"
     oid = "UDP-MIB::udpNoPorts.0"
   #  Datagrams received with error
   [[inputs.snmp.field]]
     name = "udpInErrors"
     oid = "UDP-MIB::udpInErrors.0"
   #  Datagrams sent
   [[inputs.snmp.field]]
     name = "udpOutDatagrams"
     oid = "UDP-MIB::udpOutDatagrams.0"
   ##
   ## TCP statistics
   ##
   #  Number of CLOSED -> SYN-SENT transitions
   [[inputs.snmp.field]]
     name = "tcpActiveOpens"
     oid = "TCP-MIB::tcpActiveOpens.0"
   #  Number of SYN-RCVD -> LISTEN transitions
   [[inputs.snmp.field]]
     name = "tcpPassiveOpens"
     oid = "TCP-MIB::tcpPassiveOpens.0"
   #  Number of SYN-SENT/RCVD -> CLOSED transitions
   [[inputs.snmp.field]]
     name = "tcpAttemptFails"
     oid = "TCP-MIB::tcpAttemptFails.0"
   #  Number of ESTABLISHED/CLOSE-WAIT -> CLOSED transitions
   [[inputs.snmp.field]]
     name = "tcpEstabResets"
     oid = "TCP-MIB::tcpEstabResets.0"
   #  Number of ESTABLISHED or CLOSE-WAIT
   [[inputs.snmp.field]]
     name = "tcpCurrEstab"
     oid = "TCP-MIB::tcpCurrEstab.0"
   #  Number of segments received
   [[inputs.snmp.field]]
     name = "tcpInSegs"
     oid = "TCP-MIB::tcpInSegs.0"
   #  Number of segments sent
   [[inputs.snmp.field]]
     name = "tcpOutSegs"
     oid = "TCP-MIB::tcpOutSegs.0"
   #  Number of segments retransmitted
   [[inputs.snmp.field]]
     name = "tcpRetransSegs"
     oid = "TCP-MIB::tcpRetransSegs.0"
   #  Number of segments received with error
   [[inputs.snmp.field]]
     name = "tcpInErrs"
     oid = "TCP-MIB::tcpInErrs.0"
   #  Number of segments sent w/RST
   [[inputs.snmp.field]]
     name = "tcpOutRsts"
     oid = "TCP-MIB::tcpOutRsts.0"
   ##
   ## IP routing statistics
   ##
   #  Number of valid routing entries
   [[inputs.snmp.field]]
     name = "inetCidrRouteNumber"
     oid = "IP-FORWARD-MIB::inetCidrRouteNumber.0"
   #  Number of valid entries discarded
   [[inputs.snmp.field]]
     name = "inetCidrRouteDiscards"
     oid = "IP-FORWARD-MIB::inetCidrRouteDiscards.0"
   #  Number of valid forwarding entries
   [[inputs.snmp.field]]
     name = "ipForwardNumber"
     oid = "IP-FORWARD-MIB::ipForwardNumber.0"
   ##
   ## IP routing statistics
   ##
   # Number of valid routes discarded
   [[inputs.snmp.field]]
     name = "ipRoutingDiscards"
     oid = "RFC1213-MIB::ipRoutingDiscards.0"
   ##
   ## SNMP metrics
   ##
   #  Number of SNMP messages received
   [[inputs.snmp.field]]
     name = "snmpInPkts"
     oid = "SNMPv2-MIB::snmpInPkts.0"
   #  Number of SNMP Get-Request received
   [[inputs.snmp.field]]
     name = "snmpInGetRequests"
     oid = "SNMPv2-MIB::snmpInGetRequests.0"
   #  Number of SNMP Get-Next received
   [[inputs.snmp.field]]
     name = "snmpInGetNexts"
     oid = "SNMPv2-MIB::snmpInGetNexts.0"
   #  Number of SNMP objects requested
   [[inputs.snmp.field]]
     name = "snmpInTotalReqVars"
     oid = "SNMPv2-MIB::snmpInTotalReqVars.0"
   #  Number of SNMP Get-Response received
   [[inputs.snmp.field]]
     name = "snmpInGetResponses"
     oid = "SNMPv2-MIB::snmpInGetResponses.0"
   #  Number of SNMP messages sent
   [[inputs.snmp.field]]
     name = "snmpOutPkts"
     oid = "SNMPv2-MIB::snmpOutPkts.0"
   #  Number of SNMP Get-Request sent
   [[inputs.snmp.field]]
     name = "snmpOutGetRequests"
     oid = "SNMPv2-MIB::snmpOutGetRequests.0"
   #  Number of SNMP Get-Next sent
   [[inputs.snmp.field]]
     name = "snmpOutGetNexts"
     oid = "SNMPv2-MIB::snmpOutGetNexts.0"
   #  Number of SNMP Get-Response sent
   [[inputs.snmp.field]]
     name = "snmpOutGetResponses"
     oid = "SNMPv2-MIB::snmpOutGetResponses.0"