Telegraf SNMP OID not working

Hallo guys,

first i´d like to apologize for my bad english its not my nature language but i will try to give my best :slight_smile:

Im trying to get Telegraf and SNMP to work, but i have some troubles with my config

[[inputs.snmp]]
  agents = [ "10.0.0.1:161" ]
  version = 2
  community = "public"
  name = "router"

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

  [[inputs.snmp.table]]
name = "snmp"
inherit_tags = [ "hostname" ]
oid = "IF-MIB::ifXTable"


  [[inputs.snmp.table]]
name = "test"
inherit_tags = [ "hostname" ]
oid = ".1.3.6.1.4.1.2356.11.1.47.3.0"

  [[inputs.snmp.field]]
name = "test2"
oid = ".1.3.6.1.4.1.2356.11.1.47.3.0"

test and test2 are not working . do i need to put in the oid field something like “RFC1213-MIB::sysName.0” ? Or are Numbers also working ?

Numeric OIDs should work. For example, here’s an snmp input with a OID name:

  [[inputs.snmp.table]]
    #oid = "IF-MIB::ifXTable"
    name = "ifXTable"
    index_as_tag = true
    [[inputs.snmp.table.field]]
      oid = "IF-MIB::ifHCInOctets"
      is_tag = false

If you change the oid setting to the numerical equivalent it works the same:

  [[inputs.snmp.table]]
    #oid = "IF-MIB::ifXTable"
    name = "ifXTable"
    index_as_tag = true
    [[inputs.snmp.table.field]]
      oid = "1.3.6.1.2.1.31.1.1.1.6"
      is_tag = false

Hope that helps!

1 Like