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

LLD macro {#I} is not resolved when postgresql is used as the database for zabbix

XMLWordPrintable

    • Sprint 59 (Dec 2019)
    • 0.25

      Problem description: When postgresql is used as zabbix database, LLD macro {#I} is not resolved when, for example, it is used in a preprocessing step of an item prototype. Such problem doesn't occur for exactly the same setup and MySQL.

      Steps to reproduce:

      1. Create a trapper item (type of information = text)
      2. Create a low level discovery rule that depends on this item
      3. Specify the following macros for the LLD:
        {#ID} => $.id
        {#X} => $.index
      4. Create an item prototype with the following parameters:
        Type = Dependent item
        Key = item{#ID}
        Master item = the previously created trapper item
        Type of information = text
      5. Add the following preprocessing step to the item prototype:
        Name = JSONPath
        Parameters = $.[ {#X}].id
      6. Send the following string to the trapper item created in step 1:
        [{"id":101,"index":"0","path":"$.[0].value","dataSrc":"value","value":"test1"}]
        

        Notice that the received data was successfully processed and an item with key item[101] was discovered.

      7. Change macro {#X} to {#I} in LLD macros and in the preprocessing step of the created item prototype.
      8. Remove the previously discovered item with key item[101]
      9. Send the same string again to the trapper item created in step 1:
        [{"id":101,"index":"0","path":"$.[0].value","dataSrc":"value","value":"test1"}]
        

      Result: Item was not discovered, the following error is observed in info column for the discovery rule:

      Cannot create item: invalid value for preprocessing step #1: unsupported construct in jsonpath starting with: "{#I}].id".
      

      Expected: item should be discovered, no error should be observed.

      P.S. I've checked the same scenario for MySQL, and the item got successfully discovered using macro {#I}

      Example: 

            viktors.tjarve Viktors Tjarve
            solonkins Sergejs Olonkins
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: