-
Change Request
-
Resolution: Unresolved
-
Trivial
-
None
-
6.0.10, 6.2.4, 6.4.0beta3
-
None
-
None
-
OS: Debian GNU/Linux 11 (bullseye)
Using official Zabbix repositories for Debian
Zabbix version: 6.0.10-1+debian11
Steps to reproduce:
- Create new Trigger on Template/Host using SNMP item discovery.
- Define {
{#MACRO}
.regexp(".*")}=1 as the trigger expression.
- Update host
Result:
Trigger not correctly firing.
Expected:
Correct evaluation of regexp() function in conjunction with SNMP LLD Macros.
Longform description:
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 by way of JSON.Path, 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:
avg(/HP CX Switch SNMP/net.if.statusifOperStatus.{#SNMPINDEX},2m)=2 and {
.regexp("{$NET.IF.IFALIAS.WATCHED}")}=1
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.