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

add modulus and integer division operators

XMLWordPrintable

      Zabbix currently supports a division operator /, which yields a floating-point value. It would be useful to have modulus (say, % or rem) and integer division (say, // or div) operators.

      One use case could be the following. Suppose we have 10 buckets (0..9, 10..19, ..., 90..99) and we wish to check whether two item values fall into the same bucket.

      If we have just the modulus operator, then we could do something like this:

      {host:ItemA.last()} - {host:ItemA.last()} % 10 <= {host:ItemB.last()} and
      {host:ItemB.last()} - {host:ItemB.last()} % 10 <= {host:ItemA.last()}
      

      If we have just the integer division operator, then it is even simpler:

      {host:ItemA.last()} // 10 = {host:ItemB.last()} // 10
      

      Without these operators, it seems non-obvious how the same can be accomplished in Zabbix.

            Unassigned Unassigned
            asaveljevs Aleksandrs Saveljevs
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: