Add the posbility to use a static index for some lookup #1445
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In some specific case, it could be useful to be able to perform a lookup with a static indexes.
By example, I have the case with the COS monitoring for Cisco devices:
we have two labels that could be interresting to add to the monitored OID:
cbQosCMName
cbQosPolicyMapName
the first one is very easy to lookup (we juste do as indicated in the example
but for the second one, it's a little more tricky:
the interesting part for this one it's to have the Policy-Name attached to the interface.
To do that, we need to do a lookup to the oid
cbQosConfigIndex
with the indexescbQosPolicyIndex
and the index1
.So, the patch change to part:
snmp-generator
:in this case, it's mandatorry because we need to add a dedicated index related to
cbQosConfigIndex
forcbQosPolicyMapName
but it's should not be the same than the index used forcbQosCMName
snmp_exporter
:You can found just bellow an example of the config I have tried in my environment: