MQTT collectd plugin

349 views
Skip to first unread message

Andrew Elwell

unread,
Nov 15, 2014, 7:26:38 PM11/15/14
to mq...@googlegroups.com
Since someone pointed out that my 'Has anyone created an MQTT Collectd
plugin?' tweet is the the top hit on google (/me waves to @njh), I
figured my "no, not yet" folllowup deserves more than 140 characters.

Wishlist: an MQTT Plugin for Collectd.
In theory the guidelines are clear -
https://collectd.org/wiki/index.php/Plugin_architecture but even
that's beyond my limited C knowledge.

Considerations:
I'd assumed that the configuration of the plugin would be to give it a
broker and one or more topics to subscribe to.
I'm not sure how the regular timed cycle of many monitoring / graphing
tools such as collectd would cope with the whole concept of a publish
model - for example if you publish a value only on change (ie,
temperature, users logged on), would you expect to update the plugin
twice or 0 times in that polling cycle? Suggestions welcome

Whilst this probably could be kludged together with some of the
command-line MQTT tools (such as mosquitto_sub) and a wrapper, or
using one of the Perl / Python libraries and the collectd perl/python
plugins, they seem a less elegant solution.

So - I've not had chance to do anything with it (and haven't got a
summer student, especially one with C skills), but think this could be
a nice addition to the community.
Posted here for discussion / ideas

Thanks
Andrew

Nicholas Humfrey

unread,
Nov 16, 2014, 5:33:17 PM11/16/14
to mq...@googlegroups.com
On 2014-11-16 00:26, Andrew Elwell wrote:
> Since someone pointed out that my 'Has anyone created an MQTT
> Collectd
> plugin?' tweet is the the top hit on google (/me waves to @njh), I
> figured my "no, not yet" folllowup deserves more than 140 characters.
>
> Wishlist: an MQTT Plugin for Collectd.
> In theory the guidelines are clear -
> https://collectd.org/wiki/index.php/Plugin_architecture but even
> that's beyond my limited C knowledge.

I really like the collectd API :-) Interested in having a go and
implementing it.


> Considerations:
> I'd assumed that the configuration of the plugin would be to give it
> a
> broker and one or more topics to subscribe to.
> I'm not sure how the regular timed cycle of many monitoring /
> graphing
> tools such as collectd would cope with the whole concept of a publish
> model - for example if you publish a value only on change (ie,
> temperature, users logged on), would you expect to update the plugin
> twice or 0 times in that polling cycle? Suggestions welcome

There is already AMQP support in collectd. I would suggest following it
as the starting point:
https://collectd.org/wiki/index.php/Plugin:AMQP

I think it would publish for every polling cycling - even if the value
hasn't changed. I am personally interested in using MQTT to publish to
an InfluxDB database - which would need to know that the value was the
same for each time point.


> Whilst this probably could be kludged together with some of the
> command-line MQTT tools (such as mosquitto_sub) and a wrapper, or
> using one of the Perl / Python libraries and the collectd perl/python
> plugins, they seem a less elegant solution.

Yes, I agree. Would be really nice to have it implemented in C.
And it seems to be in the spirit of collectd to implement in C if
possible.

What is preferable, using libmosquitto (which is currently more widely
available in distributions) or the Paho C Client library?


nick.


Reply all
Reply to author
Forward
0 new messages