I wrote a python plugin that can take multiple configs, take it as an
example:
https://github.com/GermanG/collectd_py_plugins/blob/master/memory_usage_collectd.py

In short, I needed to store them in an array to retrieve them when being
called.

Hope it helps.

Regards
 On Jan 17, 2015 2:46 PM, "Andreas Schuldei" <andr...@schuldei.org> wrote:

> 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
>
> _______________________________________________
> collectd mailing list
> collectd@verplant.org
> http://mailman.verplant.org/listinfo/collectd
>
>
_______________________________________________
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd

Reply via email to