Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-16018

Context based macro - text is seen as logical OR function

XMLWordPrintable

    • Sprint 52 (May 2019)
    • 1

      Scenario: Discovering temperature sensors on a Cisco switch using SNMP. I want to use context based macro's so that i can set a different temperature limit for all sensors.

      However with the discovered values (Temperature sensor names) i get some odd results.

      Trigger prototype configuration
      The macro {#SENSOR_NAME} is discovered with the discovery rule.

      temperature.entity"{#SENSOR_NAME}".last() > {$MAX_TEMP:"{#SENSOR_NAME}"}

      Discovered names

      This all works great in the template expression constructor. However when i run the discovery rule i get the following values for {#SENSOR_NAME} back:

      Switch 1 - WS-C3850-48T - Temp inlet Sensor 0
      Switch 1 - WS-C3850-48T - Temp Outlet Sensor 0

      The discovered triggers looks like this:

      temperature.entity["Switch 1 - WS-C3850-48T - Temp inlet Sensor 0"].last() > {$MAX_TEMP:"Switch 1 - WS-C3850-48T - Temp inlet Sensor 0"}

      However the expression constructor shows why the trigger is failing.

      It seems like the last 2 letters of the word "sensor" are being treated as a logical OR.

      The formal stuff:

      Steps to reproduce:

      1. Making an trigger prototype using a context based macro with a value that ends / has the text "or"

      Result:

      1. The trigger will use the text "or" as logical OR operator

      Expected:

      1. The trigger expression would be valid with only 1 operation

       

      It this behavior intentional, am i formatting the expression wrong, it there a workaround (other than using the SNMPINDEX in the key and context macro) or am i dealing with a bug here?

      Thanks in advance.

        1. Screenshot 2019-04-18 at 16.15.15.png
          146 kB
          Edgar Akhmetshin
        2. Screenshot 2019-04-18 at 16.15.34.png
          143 kB
          Edgar Akhmetshin
        3. Zabbix.jpg
          84 kB
          Twan K.

            averza Andrejs Verza
            TheNetworkGuy Twan K.
            Team B
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: