I am trying to write a trigger that fires when an Interface on a switch goes down. Since I only want it to fire on certain interfaces, I've written a conditional that is supposed to evaluate to TRUE only when {#IFALIAS} has certain values. I am using the regexp() function to evaluate that. However, while this method does work on another trigger that uses a LLD Macro defined in the LLD Macros tab in the Discovery rule, it doesn't seem to evaluate at all when using a LLD Macro defined via SNMP OIDs. In fact, it doesn't even matter if I evaluate against anything (.*) OR negate the result. It seems as though the entire conditional silently fails.
The expression I use is the following:
The {$NET.IF.IFALIAS.WATCHED} Macro is a regular expression definable at the host or template level. Again, it doesn't even matter whether I replace it with something like ".*". And like I said, in another template "{IFALIAS}" (with a different name of course) is defined via a JSONPath variable in the LLD Macro tab.
Any help getting this trigger to run correctly is much appreciated.
The expression I use is the following:
Code:
avg(/HP CX Switch SNMP/net.if.status[ifOperStatus.{#SNMPINDEX}],2m)=2 and {{#IFALIAS}.regexp("{$NET.IF.IFALIAS.WATCHED}")}=1
Any help getting this trigger to run correctly is much appreciated.
Comment