Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-8101

Usage of SNMP LLD Macros not possible in Discovery Trigger expressions

    XMLWordPrintable

Details

    • Change Request
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • 6.0.10, 6.2.4, 6.4.0beta3
    • None
    • None
    • None
    • OS: Debian GNU/Linux 11 (bullseye)
      Using official Zabbix repositories for Debian
      Zabbix version: 6.0.10-1+debian11

    Description

      Steps to reproduce:

      1. Create new Trigger on Template/Host using SNMP item discovery.
      2. Define { {#MACRO}

        .regexp(".*")}=1 as the trigger expression.

      3. 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 {

      {#IFALIAS}

      .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.

      Attachments

        Activity

          People

            zabbix.support Zabbix Support Team
            herr Alexander Herr
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: