I’m trying to get QoS metrics out of Cisco devices. Unfortunately, I’m not able to get index data into appropriate tags to process them later.
There is a special vendor MIB module called “CISCO-SWITCH-QOS-MIB” for gathering queueing statistics via “csqIfStatsTable” object (OID 188.8.131.52.184.108.40.206.5220.127.116.11.1). This table is made from a sequnce of it’s child objects called “csqIfStatsEntry”. Cisco MIB specifies table entry index as following:
There is another sequence within this entry definition that specifies field values and their format, too:
- csqIfStatsDirection (IfDirection),
- csqIfStatsQueueNumber (QosQueueNumber),
- csqIfStatsThresholdNumber (QosThresholdNumber),
- csqIfStatsDropPkts (Counter64)
If I fetch some values from the table, I get this result:
- 18.104.22.168.22.214.171.124.5126.96.36.199.188.8.131.52.1.1 csqIfStatsDropPkts COUNTER64 5651
Following the object definitions above I can easily convert this into:
Or even more simplified version:
By using this data I would like to create Influx tags (key:value pairs) from ifIndex, csqIfStatsDirection etc. Similarly I wish to store stats into fields (key:value) from csqIfStatsDropPkts. Unfortunatelly, this is not possible because of index handling in Telegraf SNMP plugin.
All the above mentioned values in my table (except the csqIfStatsDropPkts) are based on OID conversion. I do understand that SNMP protocol is trying to avoid duplicate data (and this is probably why this MIB specifies index objects as NOT-ACCESSIBLE). All csqIfStatsDropPkts entries have index values already encoded within the OID address. No problem here. But it is the protocol. Not me. I need something different: to process this response using those index values as well (like in the table above). So Telegraf should be able to make this tabular index OID conversion for me.
What I can get from Telegraf today is an auto-generated tag called “index”. I just put index_as_tag = true into [[inputs.snmp.table]]. Then I will get this value (following the above example):
But there is no way how to access those values separately. [[inputs.snmp.table.field]] doesn’t work, because it is an index (not a leaf). It is a pity. I can image to pair my ifIndex values with data from different tables easily (like ifName, for instance). Now look into Influx DB (or Graphite - whatever) that stores the “index” key only. Suppose I need to draw a graph with stats from all queues with number 1 (independent on the interface id or threshold nuber). This is almost impossible due to the index key (maybe some regex combined with inheriting of variables…ugh).
This is probably due to a misunderstanding of the NOT-ACCESSIBLE “flag” withing MIBs. It does not mean I shold not work with those values at all. It means that the value of this field is already there (in the OID address) - just parse it.
Can you please modify the SNMP plugin so that all index values are easily accessible (one by one) within the [[inputs.snmp.table.field]]? Individual index objects can be referenced by thier OID within MIBs: for instance the 184.108.40.206.220.127.116.11.518.104.22.168.1.1 references csqIfStatsDirection index etc.