I was wondering if there is a way not to get metrics of the interfaces without a description by using a filter in snmpcollector's template editor.
From what I have tested, if I use ifAlias => [Condition="Not Equals", Value=""] or ifDescr => [Condition="Not Equals", Value=""], all interfaces are excluded, whether they have a description or not.
snmpcollector version is 3.41
Has anyone tried this?
have you created a device filter before you created the metric family filter ?
Please refer to the documentation:
Note: A device filter must exist before you can create a metric family filter.
Yes, I have created a device filter. There were several rules for the interface filter. For example ifAlias => [Condition="Does not Contain", Value="Disabled"]. And this condition works when the above condition is not present.
Marius Nitu try using regex:
the expression /.*/ matches any character any number of times
This way every interface with an empty description shouldn't match the filter
It does not seem to be working with your regex expression. All interfaces are returned, even those with no descriptions.
This is what worked in the end:
ifAlias => [Condition="Regex", Value="^(?!\s*$).+"]