NAME ==== mqttcollect - MQTT-based Exec-plugin for collectd SYNOPSIS ======== mqttcollect [-v ] [-f *file*] DESCRIPTION =========== *mqttcollect* is an executable program which is used with collectd(1). It subscribes to any number of MQTT topics you specify, and prints values to stdout for collectd to process in an exec plugin block. PUTVAL tiggr/mqtt‐sys/gauge‐clients.inactive 1430914033:0.00 *collectd* launches *mqttcollect* which connects to the configured MQTT broker, subscribes and waits for publishes to subscribed topics in an endless loop. If an error occurs or the program exits for whichever reason, *collectd* will restart and log the reason in its log file. *mqttcollect* supports TLS connections to the MQTT broker, username/password authentication, and TLS-PSK, all configured via its configuration file. OPTIONS ======= *mqttcollect* understands the following options. -f *file* : Specify an ini-type configuration file (see below), which defaults to `/usr/local/etc/mqttcollect.ini`. -v : Verbose. CONFIGURATION ============= *mqttcollect* requires a configuration file to operate. This ini-type file must have a `[defaults]` section in which general program parameters are configured, and it will have any number of additional sections specifying the MQTT topics it is to subscribe to. For the defaults section, please consult the example file provided with the source code for a list of allowed settings. Within a *topic* section, metrics collected by *collectd* are specified. [defaults] host = localhost port = 1883 ; (1) subscribe to a wildcard and produce three metrics per subscription. ; the metric names are interpolated with `tid' from the JSON message ; payload, and the values of each metric are obtained from the ; JSON element behind the `<' [owntracks/+/+] gauge = vehicle/{tid}/speed # influxdb Server "127.0.0.1" "25826" Configure *collectd* to load our executable *mqttcollect* via its exec mechanism. Specify *mqttcollect*'s options as individual strings in the `Exec` invocation. LoadPlugin exec Exec "mosquitto:mosquitto" "/usr/bin/mqttcollect" "‐f" "/etc/my.ini" BUGS ==== Yes. AVAILABILITY ============ CREDITS ======= - This program uses *libmosquitto*, a library provided by the Mosquitto project as well as some of the excellent include files provided by INSTALLATION ============ - Obtain the source code for *mqttcollect*, adjust the `Makefile` and run `make`. SEE ALSO ======== - `collectd`(1). - AUTHOR ====== Jan-Piet Mens