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

    Details

    • Type: Problem report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.2.8, 4.4.7
    • Fix Version/s: 5.0.3rc1, 5.2.0alpha1, 5.2 (plan)
    • Component/s: Proxy (P), Server (S)
    • Labels:
      None
    • Environment:
      Zabbix 4.2 or 4.4, latest release, Ubuntu 18.
    • Team:
      Team C
    • Sprint:
      Sprint 64 (May 2020), Sprint 65 (Jun 2020), Sprint 66 (Jul 2020)
    • Story Points:
      1

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: