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

Allow to use item values as item keys by saving values to {$MACROS} (for example, in preprocessing)



    • New Feature Request
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 4.0.0rc1
    • None
    • Frontend (F), Server (S)
    • None


      There are many scenarios that would highly benefit from being able to use the one item value as the item key for a different item.

      The change is trivial, but will allow MUCH greater flexibility in using Zabbix and will allow to get rid of quite a few external scripts.

      Please see the attached screenshot for what I'd like to see (a preprocessing step).

      Let me provide a scenario.

      Zabbix 4.0 introduced HTTP Agent checks. The only problem with HTTP Agent checks is that you cannot use the result of one check in another check. While it was possible with "variables" in "Web monitoring", web monitoring did not allow you to save the result of the check.

      Here's a real-life scenario:

      A lot of APIs (we are trying to use Azure/AD) would only provide you with responses after you make a request with an authentication token.
      To get an authentication token, another request must precede, and the token has a lifetime (e.g it expires after N hours etc).

      If Zabbix allows saving an item value to a {$USERMACRO}, the following would be possible.
      1) an infrequent HTTP item (once a week) gets the authentication token and saves it to a host {$USERMACRO}, ensuring the {$USERMACRO} always has an up-to-date token (otherwise it expires)
      2) another HTTP item uses the {$USERMACRO} to connect to third party API (Azure/AD) and get the JSON with all the data at once
      3) dependent items on item in step 2) populate all the required information to relevant fields

      As a result, this would allow for a much more flexible monitoring.
      Currently, it is only possible with "curl" external scripts (but Zabbix can do a lot of it by itself, including preprocessing and json parsing, all that's needed is to save an item value to a {$USERMACRO}

      This is possible a duplicate of ZBXNEXT-4449, but the use-case/scenario is different. Also, I'm providing a PNG file of where, in my opinion, it would "fit".




            vmurzins Valdis Murzins
            ilyakruchinin Ilya Kruchinin
            28 Vote for this issue
            24 Start watching this issue