SNMP Not Collecting

I’m attempting to collect SNMP stats from a device with a custom MIB but telegraf doesn’t seem to store the OID data into influx. Here is my config (/etc/telegraf/snmp.conf):

[[outputs.influxdb]]
    url = "http://localhost:8086"
    database = "telegraf"

[[inputs.snmp]]
  agents = [ "172.16.105.10:161" ]
  version = 1
  community = "test1234"
  name = "snmp"

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

However, when I run telegraf -config /etc/telegraf/snmp.conf -test all I get is:

* Plugin: inputs.snmp, Collection 1

What’s strange about this is I can walk the device and get OID values. For instance, running snmpget -v 1 -c test1234 172.16.105.10 RFC1213-MIB::sysName.0 returns:

SNMPv2-MIB::sysName.0 = STRING: Name

Any ideas on what I might be doing wrong here or how I could debug this further (using telegraf -debug doesn’t give any extra info)?

For future reference: I turned on telegraf’s logging and found that it could not properly translate the OID. So I moved my custom MIBs to /etc/telegraf/.snmp/mibs and now it is collecting properly.

1 Like