[collectd] sending datasets to same collectd graph from python plugin

Giorgio Lansing giorgio.lansing at gmail.com
Sat May 15 22:19:39 CEST 2010

I've managed to figure this one out. I didn't know about the types.db file
at the time.

On Fri, May 14, 2010 at 7:13 PM, Giorgio Lansing
<giorgio.lansing at gmail.com>wrote:

> Hello,
> I'm running a task scheduler on my server and can extract the number of
> active tasks from the program. I have several different task "types" and
> would like the number of active tasks for each type plotted on the SAME
> graph using collectd (similar to the way multiple datasets are plotted on
> the cpu graphs. e.g. nice, user, wait etc...).
> I've read the collectd-python manpage but I still haven't figured out how
> to send multiple datasets to the same graph.
> Is there a way to modify (for instance) the sample python plugin (below) in
> the docs to graph multiple lines corresponding to different data sets like
> "spam" and "ham", and also label the data points something other than the
> default "Exec value". Thank you for your time.
> import random
> import collectd
> def read(data=None):
>     vl = collectd.Values(type='gauge')
>     vl.plugin = 'python.spam'
>     vl.dispatch(values=[random.random() * 100])
> def write(vl, data=None):
>     for i in vl.values:
>         print "%s (%s): %f" % (vl.plugin, vl.type, i)
> collectd.register_read(read)
> collectd.register_write(write)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.verplant.org/pipermail/collectd/attachments/20100515/e7da3fe8/attachment.htm 

More information about the collectd mailing list