[collectd] sending datasets to same collectd graph from python plugin
Giorgio Lansing
giorgio.lansing at gmail.com
Sat May 15 01:13:56 CEST 2010
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/20100514/0b023324/attachment.htm
More information about the collectd
mailing list