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.
this is my config, i’ve bolded the specific filed.
[[inputs.snmp]]
agents = ["udp://10.1.0.2:161"]
version = 2
community = "XXXXX"
[[inputs.snmp.field]]
name = "sysDescr"
oid = "SNMPv2-MIB::sysDescr.0"
is_tag = true
[[inputs.snmp.field]]
name = "hostname"
oid = "RFC1213-MIB::sysName.0"
is_tag = true
[[inputs.snmp.field]]
name = "diskstat"
oid = ".1.3.6.1.4.1.2021.9.1.9.1"
[[inputs.snmp.field]]
name = "5minload"
oid = ".1.3.6.1.4.1.2021.10.1.3.2"
**[[inputs.snmp.field]]**
** name = "fp"**
** oid = "1.3.6.1.4.1.1625.2.3.1.4.1.6"**
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.
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.:
[[inputs.snmp.field]]
oid = "IF-MIB::ifOperStatus.7"
using regex for indekading the interface index:
[[inputs.snmp.field]]
oid = "IF-MIB::ifOperStatus.[1-24]"