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 plugin IF-MIB::ifTable physical interface problem #1755

Closed
mnctech opened this issue Sep 12, 2016 · 4 comments · Fixed by #1784
Closed

SNMP plugin IF-MIB::ifTable physical interface problem #1755

mnctech opened this issue Sep 12, 2016 · 4 comments · Fixed by #1784
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@mnctech
Copy link

mnctech commented Sep 12, 2016

Bug report

Utilizing the new (and old) SNMP plugin for IF-MIB::ifTable there is an issue where the physaddress is being returned via SNMP correctly but Telegraf is turning it into characters before outputting it.

Relevant telegraf.conf:

[[inputs.snmp]]
  agents = [ "172.16.1.13" ]
  version = 2
  community = "public"
  interval = "10s"
  timeout = "10s"

  name = "pts_stats"
  [[inputs.snmp.field]]
    name = "hostname"
    oid = ".1.3.6.1.2.1.1.5.0"
    is_tag = true

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

System info:

ubuntu 16.04 desktop with Telegraf 1.0 and the new SNMP plugin

telegraf output

interface_stats,agent_host=172.16.1.13,host=Dell210,hostname=unnamed ifTable="�>" 1473690400000000000

tcpdump of SNMP response

10:33:00.000413 IP 172.16.3.13.50536 > 172.16.1.13.161: GetRequest(28) .1.3.6.1.2.1.1.5.0
10:33:00.043629 IP 172.16.1.13.161 > 172.16.3.13.50536: GetResponse(51) .1.3.6.1.2.1.1.5.0="development-server"
10:33:00.043877 IP 172.16.3.13.50536 > 172.16.1.13.161: GetRequest(30) .1.3.6.1.2.1.2.2.1.6.1
10:33:00.082439 IP 172.16.1.13.161 > 172.16.3.13.50536: GetResponse(36) .1.3.6.1.2.1.2.2.1.6.1=fa_16_3e_ee_85_8c

@sparrc
Copy link
Contributor

sparrc commented Sep 12, 2016

can you run an SNMP get on the MIB and OID?

snmpget -c public -v2c 172.16.1.13 IF-MIB::ifPhysAddress.1
snmpget -c public -v2c 172.16.1.13 .1.3.6.1.2.1.2.2.1.6.1

@mnctech
Copy link
Author

mnctech commented Sep 12, 2016

jdavies@Dell210:~$ snmpget -c public -v2c 172.16.1.13 IF-MIB::ifPhysAddress.1
IF-MIB::ifPhysAddress.1 = STRING: fa:16:3e:ee:85:8c

jdavies@Dell210:~$ snmpget -c public -v2c 172.16.1.13 .1.3.6.1.2.1.2.2.1.6.1
iso.3.6.1.2.1.2.2.1.6.1 = Hex-STRING: FA 16 3E EE 85 8C

@sparrc sparrc added the bug unexpected problem or unintended behavior label Sep 12, 2016
@sparrc
Copy link
Contributor

sparrc commented Sep 12, 2016

@phemmer looks like there might be a bug with Hex strings in the snmp plugin

@phemmer
Copy link
Contributor

phemmer commented Sep 12, 2016

Hrm, this is going to be sticky. The value comes across the wire as an OCTET STRING, making it indistinguishable from normal text. It's the MIB which defines the field as a PhysAddress, which is then rendered as a hex-colon string.

The only way I can see to handle this is to add a conversion for string to mac addr. For the automatic table stuff, we'd have to pull the syntax type out of the MIB, and automatically map the conversion.

EDIT (9/12): I've got this coded up. Basically added support for MAC addresses and IP addresses encoded as octet strings. Need to update tests & docs. Probably won't be done til wednesday.
Also, I wouldn't consider this a bug. More a feature request.

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants