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

Now proper way to avoid division by zero in trigger expressions

XMLWordPrintable

      I need to fire alarm when the value changes > 50%. Next trigger expression will do the trick:

      {item.change(0)}/{item.last(#2)} > 0.5

      The problem however is in case when previous value is 0, we get division by zero. Adding a check for non-zero value
      {item.last(#2)}#0 & {item.change(0)}

      /

      {item.last(#2)}

      > 0.5

      will not work as before doing any logical operations all trigger expressions are evaluated. The only workaround I could think of is always adding 0.000001 to the previous value (and hope it's integer).

            Unassigned Unassigned
            dimir dimir
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: