SNMP input returnuing string values

hi everybody

i have a telegraph agent for pulling API and SNMP data from my network device.
lately, I’ve started monitoring my DHCP clusters.
one of the OIDs is cluster status, but this query gets a string as a value ( “Normal / Normal”).

using telegraf --test --config, returns only the int values.
so I assume telegraf doesn’t accept “string values” but on the other hand, it does accept the sysname and sysdes values that are string as well.

any idea what is wrong here?
how could I solve this? maybe translating it to integer?
for example Normal == 1 , not sync == 2 , down == 3.


That is how snmp works, the value you receive is the integer, but then you need to instruct telegraf to translate them. Currently, telegraf cannot do this automatically.

See this comment for an example.

but what if the value is string? (see the snmpwalk output)
could this mapping translate string to integer?


root@lab-proxy:~# snmpwalk -v2c -c XXXXX10.1.0.2 SNMPv2-SMI::enterprises.1625.
SNMPv2-SMI::enterprises.1625. = STRING: “Normal / Normal”

Oh, I read it wrong. In that case there should be no problem. Could you show the config for that field? And what you get of output with —test


this is my config, i’ve bolded the specific filed.

  agents = ["udp://"]
  version = 2
  community = "XXXXX"

    name = "sysDescr"
    oid = "SNMPv2-MIB::sysDescr.0"
    is_tag = true

    name = "hostname"
    oid = "RFC1213-MIB::sysName.0"
    is_tag = true

    name = "diskstat"
    oid = "."

    name = "5minload"
    oid = "."

**    name = "fp"**
**    oid = ""**

–test output:

> snmp,agent_host=,host=lab-proxy,hostname=lab-dhcp-1,sysDescr=Linux\ lab-dhcp-1\ 3.10.0-1127.el7.x86_64\ #1\ SMP\ Tue\ Mar\ 31\ 23:36:51\ UTC\ 2020\ x86_64 5minload="0.01",diskstat=17i 1623325390000000000

You are requesting with telegraf while doing in your walk.

unbelievable, sorry about that
apparently I’m blind ;).

thank you @Hipska

do you know if i could use regex on the index part?

for example, IF-MIB::ifInOctets.1 will pull in octets of interface index 1, and I want to pull this field for interface index 1 to 10.
is it possible somehow?
I’ve tried but failed.


For tabled data such as interfaces, you need to specify a inputs.snmp.table. See the documentation.

yes, i know.
the thing is that my cisco switches include all VLANs in their ifTable and ifXTable, which makes the huge tables and it loading my systems.
so I know that its possible to pull only specific table entries or specific SNMP field per interface .
my question is if instead of configuring a field per interface e.g.:

  oid = "IF-MIB::ifOperStatus.7"

using regex for indekading the interface index:

  oid = "IF-MIB::ifOperStatus.[1-24]"

I’d love to hear your thoughts. thanks

I would just walk/poll them all with the table. If wanted, you can drop the VLAN interfaces afterwards so you don’t send them to your DB storage.