Solved: SNMP works with snmpwalk, but not from Telegraf

Hello.
I have a strange behavior of Telegraf with my SNMP device.
When I try snmpwalk with this specific device, everything looks OK and I get all responses I’m expecting.
But when I try to fetch data from Telegraf, nothing happens. By using tcpdump I see that Telegraf doesn’t even attempt to communicate with device, telegraf test doesn’t produce any output, while telegraf.log seems OK. Pulling data from other SNMP devices works OK.
Here is my telegraf.conf which is cleaned of all other non-related configuration.

[agent]
  interval = "20s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "1s"
  flush_interval = "10s"
  flush_jitter = "5s"
  precision = "0s"
  quiet = false
  debug = true
  logtarget = "file"
  logfile = "/var/log/telegraf/telegraf.log"

[[outputs.influxdb]]
    urls = ["http://influxdb:8086"]

[[inputs.snmp]]
  agents = ["udp://172.30.100.10:161"]
  version = 2
  community = "public"
  name = "snmp"
  timeout = "10s"

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

I just want to add that whole TIG stack is deployed as containers running on Docker.

What output do you get when running this config with telegraf --test?

Edit: Oh I see the problem, you are not collecting any metric field, only a tag.

Try adding this:

  [[inputs.snmp.field]]
    name = "uptime"
    oid = "DISMAN-EVENT-MIB::sysUpTimeInstance"
    conversion = "float(2)"

Hipska,
thank you very much. I was suspecting that issue might be something so simple, but just failed to find it.
Now I got output from test and I can see my device as query target in DB.
Thanks a lot!

Ratko

Great, please mark as solved.