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

Discovery item returns "Value should be a JSON object." on valid JSON

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Critical Critical
    • None
    • 2.2.2
    • Server (S)
    • None

      We have a Zabbix agent discovery item which detects all drives on the system and creates items which check disk reads/writes. The JSON it returns looks like this:

      {"data":[{"

      {#DISK}":"sda"},{"{#DISK}

      ":"sdb"}]}

      but the discovery item always returns "Value should be a JSON object.". It doesn't make the discovery item unsupported, just returns this error.

      Here is what I got from the zabbix server log with debug level (I changed IP and hostname, everything else is a copy paste):

      890:20140221:143212.487 In substitute_key_macros() data:'nord.check[discovery,disk_discovery]'
      890:20140221:143212.487 End of substitute_key_macros():SUCCEED data:'nord.check[discovery,disk_discovery]'
      890:20140221:143212.487 In substitute_simple_macros() data:'10050'
      890:20140221:143212.488 In get_value() key:'nord.check[discovery,disk_discovery]'
      890:20140221:143212.488 In get_value_agent() host:'server-0004' addr:'99.88.77.66' key:'nord.check[discovery,disk_discovery]'
      890:20140221:143212.488 Sending [nord.check[discovery,disk_discovery]
      890:20140221:143212.498 get value from agent result: '{"data":[{"

      {#DISK}":"sda"},{"{#DISK}

      ":"sdb"}]}'
      890:20140221:143212.498 End of get_value():SUCCEED
      890:20140221:143212.498 In activate_host() hostid:10110 itemid:25932 type:0
      890:20140221:143212.498 End of activate_host()
      890:20140221:143212.498 In lld_process_discovery_rule() itemid:25932
      890:20140221:143212.498 query [txnlev:0] [select hostid,key_,state,filter,error,lifetime from items where itemid=25932]
      890:20140221:143212.499 In substitute_simple_macros() data:'10'
      890:20140221:143212.499 In lld_rows_get()
      890:20140221:143212.499 End of lld_rows_get():FAIL
      890:20140221:143212.499 End of lld_process_discovery_rule()

      As I can see lld_rows_get() fails. This happens for all hosts.

      I would also like to mention that we used these same discovery items on Zabbix 2.0 and they worked without any problems, and we imported them into 2.2. We had one problem after import, since our script was returning a trailing coma in JSON, so Zabbix 2.2 reported unsupported item, since the JSON parser has changed to be more strict in 2.2, but we fixed that comma as you can see from the logs.

        1. discovery.sh
          0.5 kB
          Strahinja Kustudic

            Unassigned Unassigned
            kustodian Strahinja Kustudic
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: