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

SNMP not working since upgrading to 1.21.4 #10810

Closed
Serverlag opened this issue Mar 13, 2022 · 5 comments · Fixed by #10802
Closed

SNMP not working since upgrading to 1.21.4 #10810

Serverlag opened this issue Mar 13, 2022 · 5 comments · Fixed by #10802

Comments

@Serverlag
Copy link

Serverlag commented Mar 13, 2022

Relevant telegraf.conf

  agents = [ "<removed>" ]
  version = 2
  community = "<removed>"

  [[inputs.snmp.field]]
    name = "hostname"
    oid = "RFC1213-MIB::sysName.0"
    is_tag = true

[[inputs.snmp.field]]
name = "ifName"
oid = "IF-MIB::ifName.1"
is_tag = true

[[inputs.snmp.field]]
name = "ifHCInOctets"
oid = "IF-MIB::ifHCInOctets.1"

[[inputs.snmp.field]]
name = "ifHCOutOctets"
oid = "IF-MIB::ifHCOutOctets.1"

[[inputs.snmp.field]]
name = "fgSysMemUsage"
oid = "FORTINET-FORTIGATE-MIB::fgSysMemUsage.0"

[[inputs.snmp.field]]
name = "fgSysUpTime"
oid = "FORTINET-FORTIGATE-MIB::fgSysUpTime.0"

[[inputs.snmp.field]]
name = "fgSysCpuUsage"
oid = "FORTINET-FORTIGATE-MIB::fgSysCpuUsage.0"

Logs from Telegraf

2022-03-13T06:08:21Z W! [inputs.snmp] Couldn't stat target /usr/share/snmp/mibs
2022-03-13T06:08:21Z W! [inputs.snmp] Couldn't stat target /usr/share/snmp/mibs
2022-03-13T06:08:27Z W! [inputs.snmp] module DPI20-MIB could not be loaded
2022-03-13T06:08:29Z W! [inputs.snmp] module HPR-MIB could not be loaded
2022-03-13T06:08:37Z W! [inputs.snmp] module SNMPv2-PDU could not be loaded
2022-03-13T06:08:38Z W! [inputs.snmp] module TCPIPX-MIB could not be loaded
2022-03-13T06:08:39Z E! [telegraf] Error running agent: could not initialize input inputs.snmp: initializing field fgSysMemUsage: translating: cannot make FORTINET-FORTIGATE-MIB::fgSysMemUsage.0 numeric, please ensure all imported mibs are in the path

Restarting Telegraf

2022-03-13T06:04:12Z I! Starting Telegraf 1.21.4
2022-03-13T06:04:12Z I! Using config file: /etc/telegraf/telegraf.conf
Parse module: /var/lib/snmp/mibs/ietf/DPI20-MIB:9:4: unexpected "ibm" (expected ";")
Parse module: /var/lib/snmp/mibs/ietf/HPR-MIB:494:30: unexpected "HprRtpCounter" (expected "}")
Parse module: /var/lib/snmp/mibs/ietf/SNMPv2-PDU:73:1: unexpected "max-bindings" (expected "END")
Parse module: /var/lib/snmp/mibs/ietf/TCPIPX-MIB:63:12: unexpected "tcpIpxConnLocalPort" (expected "}")

System info

telegraf 1.21.4

Docker

No response

Steps to reproduce

  1. Upgrade from pre-1.21 versions to 1.21.4 (my example case here was from 1.19.1 to 1.21.4)
  2. Restart Telegraf

Expected behavior

1.21.x releases should work with existing mibs that were working in 1.19.1 and 1.20.4

Actual behavior

Errors generated during service restart, errors generated in telegraf log and also no data in influxdb for expected snmp inputs.

Additional Info

Downgrading to 1.20.4 resolves the issue, I have found both #10793 and #10445 which seem to indicate they are also experiencing SNMP issues post 1.21.x upgrade.

@elacour
Copy link

elacour commented Mar 16, 2022

Same symptoms, same problem here, using debian stretch.

@reimda
Copy link
Contributor

reimda commented Mar 19, 2022

Hi @Serverlag and @elacour, we recently merged a change that switches back to the 1.20.4 behavior (#10802). It's in the nightly build now. Could you try the nightly build to see if it works for you? We're planning to release this in 1.23.0 which is scheduled for next Wednesday, March 23. If you could report what you find it would help us flush out bugs and gain confidence in the change.

Nightly builds: https://github.com/influxdata/telegraf/blob/master/docs/NIGHTLIES.md

@Serverlag
Copy link
Author

Serverlag commented Mar 19, 2022

Hi @reimda, so far promising results. Looking at below logs during start we see no further SNMP errors, SNMP data collection is working and I can confirm data in influxdb for all existing inputs I was using in both 1.19 and 1.21. If I notice any further issues I will report them as requested.

2022-03-19T09:29:31Z I! [agent] Stopping running outputs
2022-03-19T09:29:46Z I! Starting Telegraf 1.22.0-77040ef4
2022-03-19T09:29:46Z I! Loaded inputs: dns_query ping snmp
2022-03-19T09:29:46Z I! Loaded aggregators:
2022-03-19T09:29:46Z I! Loaded processors:
2022-03-19T09:29:46Z I! Loaded outputs: influxdb
2022-03-19T09:29:46Z I! Tags enabled: host=<redacted>
2022-03-19T09:29:46Z I! [agent] Config: Interval:5s, Quiet:false, Hostname:"<redacted>", Flush Interval:5s

@reimda
Copy link
Contributor

reimda commented Mar 19, 2022

Good to hear. Thanks for testing, @Serverlag!

@elacour
Copy link

elacour commented Mar 21, 2022

Hi @Serverlag and @elacour, we recently merged a change that switches back to the 1.20.4 behavior (#10802). It's in the nightly build now. Could you try the nightly build to see if it works for you?

just tested, it works, thanks!

@Hipska Hipska linked a pull request Mar 23, 2022 that will close this issue
@Hipska Hipska closed this as completed Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants