Skip to main content

Create round robind database files form MQTT messages.

Project description

Like as MQTT2RRD and it’s forks, MQTToRRD create round robin database files from MQTT messages.

Tool daemon is based on poho-mqtt and python-daemon packages. All dependencies are listed in requirements.txt file. As Python 2.x is deprecated, tool is write for Python 3.5 or more only. For example signal.Signals class is use.

Usage

usage: $(prog)s [options] command

Create round robind database files form MQTT.

positional arguments:
  command               Daemon action (start|stop|restart|status)

optional arguments:
  -h, --help            show this help message and exit
  -c <file>, --config <file>
                        Path to config file.
  -f, --foreground      Run as script on foreground

Install

~# pip3 install mqttorrd

Configuration

[daemon]

data_dir:

Directory to store round robin database files. Default value is /var/lib/mqttorrd.

pid_file:

Path of file with pid. Default value is /var/run/mqttorrd.pid.

user:

Daemon user, default nobody.

group:

Daemon group, default nogroup.

Data directory must be writer with user or group as pid file. Each value from MQTT broker is store to it’s rrd file with path from topic. For example: /var/lib/mqttorrd/garden/pool/temperature.rrd.

[logging]

handler:

Python logging handler. Possible values are file or syslog. When tool is run at foreground, stderr handler is use. On UNIX like systems, WatchedFileHandler is used. Defaults to syslog.

syslog:

Syslog connection, /dev/log by default. LOG_DAEMON facility is used.

file:

Path to log file if file handler is used. Defaults to /var/log/mqttorrd.log.

level:

One of Python logging level: DEBUG, INFO, WARNING, ERROR, CRITICAL. Default value is ERROR.

format:

Logging format. Default value is %(asctime)s %(levelname)s: %(name)s: %(message)s "{%(funcName)s():%(lineno)d}.

[mqtt]

client_id:

MQTT client id. If is not defined, it is generate automatically.

hostname:

Broker hostname, localhost by default.

port:

Broker port, 1883 is allways default.

keepalive:

The keepalive timeout value for the client. Defaults to 60 seconds.

tls:

TLS connection, default False.

ca_certs:

Path to the Certificate Authority certificate. If is not set, system certs path is use.

certfile:

Client public certificate file.

keyfile:

Client primary key file.

username:

Client username

password:

Client password

subscriptions:

Coma separated topics to subscribe. Default value is /#.

[/#]

For any topics could be defined own RRD parameters. MQTT characters like # and + could be use. If new topic message was received,first definition, which is matched is used. If database file is exist yet, only value are update. For more information see https://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html.

step:

Round Robin Database step. Defaults to 60 seconds.

DS:

Data source definition. Default value is DS:{topic}:GAUGE:120:U:U, where {topic} is replaced with file name as last topics part.

RRA:

Value archive definition. Default value is

RRA:AVERAGE:0.5:2:30,
RRA:AVERAGE:0.5:5:288,
RRA:AVERAGE:0.5:30:336,
RRA:AVERAGE:0.5:60:1488,
RRA:AVERAGE:0.5:720:744,
RRA:AVERAGE:0.5:1440:265

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mqttorrd-0.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

mqttorrd-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file mqttorrd-0.1.0.tar.gz.

File metadata

  • Download URL: mqttorrd-0.1.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mqttorrd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 941c4afed0e5939771fd08e3d05427d0aeabc0eda5c9e0b0c1f9bfba5e71da47
MD5 d25a2912146efa4830a400bb501e30ea
BLAKE2b-256 e173a517fac656626153046d8897da1c64881d4b12ec2ae235e27a5e229c3563

See more details on using hashes here.

File details

Details for the file mqttorrd-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mqttorrd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 613d0602797595d70ead1c73a0fb0643f336ed82b9591ffe237580d8c24c67ef
MD5 9a9844a9c9ea56b1b689deacb5917fcc
BLAKE2b-256 00884f74c47cbf2d4b345f9f56105e0d486a1fe1e422ba4a25d8676e1ca52393

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page