snmpcollector icon indicating copy to clipboard operation
snmpcollector copied to clipboard

[Feature Request] Apply tag on match of OID Condition

Open tardoe opened this issue 7 years ago • 5 comments

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.

tardoe avatar Apr 05 '17 22:04 tardoe

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!

sbengo avatar Apr 06 '17 14:04 sbengo

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.

tardoe avatar Apr 07 '17 00:04 tardoe

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

image

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

toni-moreno avatar Apr 21 '17 12:04 toni-moreno

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.

toni-moreno avatar Apr 21 '17 18:04 toni-moreno

Hmmmm so a true upon a string parse could result in a tag action?

tardoe avatar May 16 '17 22:05 tardoe