[rrd-developers] PATCH: Fix for JSON output format
Tobias Oetiker
tobi at oetiker.ch
Thu Sep 13 14:13:55 CEST 2012
Hi Thomas,
Sep 5 Thomas Mainka wrote:
> Hi everyone,
>
>
> Recently I have experimented with dynamic graphing of RRDtool data on web
> pages (as JSON data queried by jQuery). While the JSON export and transport
> worked fine, after some testing I realized that starting with version 1.4
> jQuery rejects JSON data which it thinks is malformed. When directly fed the
> output output of "rrdtool xport --json" jQuery barfs with an syntax error.
>
> Of course there are workarounds, but the attached fix is pretty trivial: Only
> the double quotes were missing in most of the JSON output from RRDtool to pass
> the jQuery test. The JSON standard is pretty strict on strings and requires
> any string to be wrapped in double quotes: http://json.org/
>
> Personally I have also tested the resulting output with http://jsonlint.org/
> and http://www.jsoneditoronline.org/ which both worked for me. YMMV, though.
thanks for your patch ... someone has beaten you to it though ...
the output format is fixed in both master and the 1.4 branch ... it
will be included in the next release ...
cheers
tobi
>
>
> Regards,
> Thomas
>
--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900
More information about the rrd-developers
mailing list