snmpcollector
snmpcollector copied to clipboard
[Feature Request] Apply tag on match of OID Condition
Given an OID Condition evaluates to true, allow the user to specify a tag to be applied to the metric without filtering.
E.g. I'd like to be able to clarify interfaces based on a regex applied to the ifAlias for customer, core, edge, upstream etc.
Hi @tardoe , I'm not pretty sure that I understood the use case of your FR.
Can you give us a more specific example?
Thanks, Greetings!
Say I have an interface with the ifAlias of "TRANSIT - AS12345 2gbit" I would then want to match on the Alias with a regex like "^TRANSIT.*$ and if this matches, apply the label "interface_role=transit" to the metrics from that interface.
Hi @tardoe this feature could be implemented better with a new kind of metric object .
Something like "conditional tag " would be something similar to the STRINGEVAL but instead of apply a "generic evaluation" over some "fields" . A set of "fielname/regex conditions/tagname" if true could be applied .
By example:
if you have a field ifAlias snmpmetric
You could define :
- id: cond_role
- FieldName: interface_role
- BASEOID:
- DataSrcType: COND_TAG
- Extradata: (a set of matching rules) [Alias|^TRANSIT.$|transit] [Alias|^OTHER.$|other] [Alias[^FIRST.*$|first]
I need to think a little more on this, not sure if this definition is good enouth
I've reviewed https://github.com/toni-moreno/snmpcollector/issues/92 and I've noted a similar behaviour requested by @sbengo
Base OID: 1.3.6.1.4.1.7779.3.1.1.2.1.10.1.3.3X
Type: Boolean stringParser
True : .*OK$
False: .*KO$
So the result would be:
Power1 : 1
Power2 : 0
There are two slightly differences.
#165 data origin is another field and result shlould be sent as TAG #92 the data is the result from a snmp get from a defined OID and result should be sent as FIELD
but both has a match mapping and a user defined result.
Perhaps both request can be join as a new "cooked type' , not COND TAG better MATCH_SET or something similar.
Hmmmm so a true upon a string parse could result in a tag action?