SNMP Index multiple depths:

We want to add tags to our snmp polling. The tags are related to the table we query and are indexes according to the MIB we use.

We try to use the oid_index_suffix and oid_index_length, but either it’s not functioning or we use it in an in proper way. Below we have the output of an metric received and after that the configuration.

We would have expected that with the oid_index_length we would be able to specify the length of the index after the OID. So for a BGP neighbor we have 4 dot’s (depth) after the root/base of the OID.

With the oid_index_suffix we expected to match the end of the OID so the trailing 1.1 and 1. But as you can see the metric did not match any of the snmp.table.fields as index.

Hope someone can help us and tell what we are doing wrong or if we hitting a bug. An possible feature request would be to specify per index the exact off-set from the end of the OID or the beginning and it’s length.

Output metric:
cisco_BGP_Stats_cbgpPeerAcceptedPrefixes{agent_host=“10.10.10.10”,host=“e955e22ac07f”,index=“10.22.22.22.1.128”,instance=“10.44.44.44:9126”,job=“telegraf”,site=“Testlab”,sysName=“router01.my.domain”} 82

Configuration excerpt:

[[inputs.snmp.table]]
name = “cisco_BGP_Stats”
inherit_tags = [“sysName”, “bgpPeerRemoteAddr”, “cbgpPeerAddrFamilyAfi”, “cbgpPeerAddrFamilySafi”]
oid = “CISCO-BGP4-MIB::cbgpPeerAddrFamilyPrefixTable”
index_as_tag = true
#oid_index_suffix = “1.1”

[[inputs.snmp.table.field]]
  oid = "BGP4-MIB::bgpPeerRemoteAddr"
  name = "bgpPeerRemoteAddr"
  is_tag = true
  oid_index_suffix = "1.1"

[[inputs.snmp.table.field]]
  oid = "CISCO-BGP4-MIB::cbgpPeerAddrFamilyAfi"
  name = "cbgpPeerAddrFamilyAfi"
  is_tag = true
  oid_index_suffix = "1"
  oid_index_length = 4

[[inputs.snmp.table.field]]
  oid = "CISCO-BGP4-MIB::cbgpPeerAddrFamilySafi"
  name = "cbgpPeerAddrFamilySafi"
  is_tag = true
  oid_index_length = 5