[collectd] Missing data in JSON output

Bob Cotton bcotton at rallydev.com
Wed Mar 17 18:36:06 CET 2010


I'm playing  with the amqp output plugin, wihch uses util_format_json.c for
putting the values in the wire.

However, for multi-valued samples the name each value, as well as the type
(COUNTER, GUAGE etc) are missing.
For example, for load average the json looks like this:
[
  {"values":[0.0561523,0.188477,0.276855],
   "time":1268776516,
   "interval":10,
   "host":"host.domain.com",
   "plugin":"load",
   "plugin_instance":"",
   "type":"load",
   "type_instance":""}
]

The three values are named 'shortterm', 'midterm' and 'longterm' and are all
of type GUAGE.

For systems that are "far away" from collectd without access to the types
database, it would be nice to have this info.

May I suggest a format for the JSON to incorporate this data.
Again, using load as an example:
[
  {"values":{"shortterm:GUAGE":0.0561523, "midterm:GUAGE":0.188477,
"longterm:GUAGE":0.276855},
   "time":1268776516,
   "interval":10,
   "host":"host.domain.com",
   "plugin":"load",
   "plugin_instance":"",
   "type":"load",
   "type_instance":""}
]

Basically changing "values" from an array to a hash, keyed by a
"name:type".

Thoughts?

- Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.verplant.org/pipermail/collectd/attachments/20100317/9a7a97a8/attachment.htm 


More information about the collectd mailing list