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

The behavior of the strlen(#num) function does not match the documentation

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Duplicate
    • Icon: Trivial Trivial
    • None
    • 5.0.4
    • Server (S)
    • None
    • Debain 9

      Steps to reproduce:

      1. Create a trapper text item and a trigger with a condition using this item:

      {host:trapper_text_item.strlen(#1)}>0 and {host:trapper_text_item.strlen(#2)}>0 and {host:trapper_text_item.strlen(#3)}>0

      Thus, we would like to fire this trigger when 3 last values of this item are not empty.

      Based on https://www.zabbix.com/documentation/5.0/manual/appendix/triggers/functions,  we can expect it, because:

      ⇒ strlen()(is equal to strlen(#1)) → length of the latest value
      ⇒ strlen(#3) → length of the third most recent value

       

      2. Send 3 empty string to this item (just to collect enough data):

       

      3. Send 1 non-empty string to this item:

       

      Result:
      The trigger was fired:

      Expected:
      The trigger wasn't fired because the second and the third most recent values have empty string and their length is 0.

        1. 1 Item and trigger.png
          1 Item and trigger.png
          17 kB
        2. 2 Empty values.png
          2 Empty values.png
          8 kB
        3. 3 Empty values + non-empty value.png
          3 Empty values + non-empty value.png
          9 kB
        4. 4 Trgigger was fired.png
          4 Trgigger was fired.png
          7 kB
        5. 5 Event details.png
          5 Event details.png
          45 kB
        6. 6 Doc.png
          6 Doc.png
          33 kB

            agavrilovs Aleksandrs Petrovs-Gavrilovs
            antpal Anton Palmov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: