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

Custom on fail Preprocessing not working as expected for calculated items (in combination with value type)

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Fixed
    • Icon: Minor Minor
    • 5.0.3rc1, 5.2.0alpha1, 5.2 (plan)
    • 4.2.8, 4.4.7
    • Proxy (P), Server (S)
    • None
    • Zabbix 4.2 or 4.4, latest release, Ubuntu 18.
    • Team C
    • Sprint 64 (May 2020), Sprint 65 (Jun 2020), Sprint 66 (Jul 2020)
    • 1

      I have a calculated item that is expected to return a positive integer. In some rare cases, a negative number is being returned by the calculation. I want to use Item Preprocessing with "custom on fail" to set the Item to return a value of "0" instead of the negative number. See attached screenshot for Preprocessing options used.

      With this configuration set, the item gets into "Not supported" state with the error message "Received value [-5.000000] is not suitable for value type [Numeric (unsigned)]." which should not be happening. Instead of such an error message, the value should just be set to 0 which is indeed a valid Unsigned Integer. I suppose the checking for Value Type is happening too early in this specific combination.

      On the other hand, if I configure the Item the exact same way, but instead of being a Calculated Item I configure it to be a Agent-based item, getting a negative number back (doesn't matter whether a "negative Integer" or a "negative Float"), the Preprocessing with custom on fail works correctly and in "Latest Data" I see a value of "0" for the item.

      Steps to reproduce:

      1. Create a Calculated Item and put the following in the forumula: "10-15", Value Type "Numeric (unsigned)
      2. Set the Pre-Processing as shown in attached screenshot
      3. Observe output of the Item in "Latest Data"

      Result:
      Item will be "Not supported" with following error message: "Received value [-5.000000] is not suitable for value type [Numeric (unsigned)]."

      Expected:
      Value set to 0

       

      Steps to reproduce it works with an agent based item:

      1. Create a Userparameter: UserParameter=neg.num,echo "-5.000"
      2. Change the existing test item to be a Agent based item with key "neg.num", leave value type at "Numeric (unsigned)" and Preprocessing as-is.
      3. Item will change to value of 0 as expected

       

      Additional information:

      The desired Custom on Fail works if I set the Value Type to "Float", but this should not be the solution to the problem.

            arimdjonoks Artjoms Rimdjonoks
            christiananton Christian Anton
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: