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

v1.6.0 caps large integer values for SNMP metrics at 2147483647 #4052

Closed
GainfulShrimp opened this issue Apr 20, 2018 · 0 comments · Fixed by #4054
Closed

v1.6.0 caps large integer values for SNMP metrics at 2147483647 #4052

GainfulShrimp opened this issue Apr 20, 2018 · 0 comments · Fixed by #4054
Labels
bug unexpected problem or unintended behavior regression something that used to work, but is now broken
Milestone

Comments

@GainfulShrimp
Copy link

Bug report

After upgrading to v1.6.0, any values from SNMP input plugin larger than 2147483647 were reported as 2147483647 instead of their true value. I noticed this for network interface counter metrics.

Relevant telegraf.conf:

I haven't included whole config, but here's a snippet for getting 'if_counter' values from my SNMP-monitored hosts:

  [[inputs.snmp.table]]
    ## measurement name
    name = "if_counters"
    inherit_tags = [ "hostname" ]
    [[inputs.snmp.table.field]]
      name = "bytes_recv"
      oid = ".1.3.6.1.2.1.31.1.1.1.6"
    [[inputs.snmp.table.field]]
      name = "bytes_sent"
      oid = ".1.3.6.1.2.1.31.1.1.1.10"
    [[inputs.snmp.table.field]]
      name = "interface"
      oid = ".1.3.6.1.2.1.31.1.1.1.1"
      is_tag = true

System info:

Telegraf 1.6.0-1
System is a Raspberry Pi 3 (armhf) running latest Raspbian Stretch Lite

Steps to reproduce:

  1. Setup Telegraf SNMP input plugin to monitor network interface 64-bit counters for busy interfaces.
  2. Make sure some counter values are bigger than 2147483647 (e.g. using snmpget/snmpwalk to view the OID/MIB values you set up in step 1).
  3. Add a file output for Telegraf so that you can easily see what's being sent to InfluxDB.

Expected behavior:

The true values from the interface counters should be reported, like this:

if_counters,interface=eth0,hostname=ubnt,agent_host=192.168.2.1,host=pi5 bytes_recv=624642439992i,bytes_sent=222558637140i 1524207960000000000
if_counters,interface=eth1,hostname=ubnt,agent_host=192.168.2.1,host=pi5 bytes_recv=225602092038i,bytes_sent=625001398888i 1524207960000000000

Actual behavior:

Values are all capped at 2147483647 before being sent:

if_counters,agent_host=192.168.2.1,host=pi5,hostname=ubnt,interface=eth0 bytes_recv=2147483647i,bytes_sent=2147483647i 1524207690000000000
if_counters,agent_host=192.168.2.1,host=pi5,hostname=ubnt,interface=eth1 bytes_recv=2147483647i,bytes_sent=2147483647i 1524207690000000000

Additional info:

This works fine in 1.5.3-1 (and many previous versions too).

Just to make sure it was 1.6.0-1 causing the issue, I downgraded Telegraf using the following commands (I kept the exact same config) and now the correct values are being sent again:

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

Use case: [Why is this important (helps with prioritizing requests)]

I'm not sure if this just affects SNMP or is a general issue with Telegraf and large (bigger than 32-bit) integers, but it feels quite important.

@danielnelson danielnelson added this to the 1.6.1 milestone Apr 20, 2018
@danielnelson danielnelson added bug unexpected problem or unintended behavior regression something that used to work, but is now broken labels Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior regression something that used to work, but is now broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants