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

Possible invalid JSON implementation on Zabbix Proxy

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.3.1
    • 2.2.2
    • Proxy (P)
    • Zabbix Proxy 2.2.2 compiled on OpenBSD 5.4

      Sending a floating point value formatted in JSON to the Zabbix Proxy does not result in an error but zeros numbers after decimal point.

      I think this is a reasonably important bug because no error message is returned and the reliability and accuracy of data collection is reduced.

      Example problem query to Zabbix Proxy:
      ZBXD {"request":"sender data","clock":1399187198,"data":[

      {"host":"14.1.2","clock":1399187198,"key":"temperature","value":23.345552}

      ]}

      The query above succeeds but the example temperature value (23.345552) gets reduced to (23.000000) when observed in the database (the datatype in the database is definitely float).

      Example solution:
      ZBXD {"request":"sender data","clock":1399187198,"data":[

      {"host":"14.1.2","clock":1399187198,"key":"temperature","value":"23.345552"}

      ]}

      By quoting the floating value ("23.345552") it is received correctly by the Zabbix Proxy and no precision is lost.

      The JSON format specifies the transmission of numbers including floats as not requiring quotes as below.
      "A number can be represented as integer, real, or floating point. JSON does not support octal or hex because it is minimal. It does not have values for NaN or Infinity because it does not want to be tied to any particular internal representation. Numbers are not quoted." - http://www.json.org/fatfree.html

      I have not tested the Zabbix Server or other versions of the Zabbix Proxy to see if this bug exists elsewhere.

      Thanks for your time team. I hope I have provided enough information for this to be resolved.

      Where do I send the beer?

            Unassigned Unassigned
            sjcrookes Sam Crookes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: