[collectd] how does a plugin keep track of multiple configurations?
Andreas Schuldei
andreas at schuldei.org
Sat Jan 17 18:43:20 CET 2015
Hi!
i have this kind of config section, because i have two (and perhaps later
on even more) devices to monitor:
LoadPlugin "OneWireCtlr"
<Plugin onewirectlr>
host "192.168.2.223"
<1DA7F30D0000006F>
type "counter"
name "Solarthermie"
</1DA7F30D0000006F>
</Plugin>
<Plugin onewirectlr>
host "192.168.2.222"
<1DA7F30D0000006A>
type "counter"
name "Ofen"
</1DA7F30D0000006A>
</Plugin>
Now i see that the config callback of my plugin is called twice, once with
each set of config parameters.
>From then on the plugin's read callback is called in every 10s (which is
also the "Interval" setting in the config file), but not twice per
interval, but only once.
Is there a way i can get collectd to maintain two, or, more precise: as
many contents of my plugin as there are config sections for it? Or should
the config callback take care to create multiple instances of its own and
then run the read code once for each instance?
what is an example plugin to do this kind of multiplexing, so i can educate
myself from it?
/andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20150117/c0157c22/attachment.html>
More information about the collectd
mailing list