从mqtt消息创建round robind数据库文件。

mqttorrd的Python项目详细描述


就像是叉子一样, mqttorrd从mqtt消息创建循环数据库文件。

工具守护进程基于poho-mqttpython-daemon包。全部 依赖项列在requirements.txt文件中。作为python 2.x 不推荐使用,该工具仅适用于Python3.5或更高版本。例如 signal.Signals类正在使用。

用法

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

安装

~# pip3 install mqttorrd

配置

[守护进程]

data_dir:Directory to store round robin database files. Default value is ^{tt5}$.
pid_file:Path of file with pid. Default value is ^{tt6}$.
user:Daemon user, default ^{tt7}$.
group:Daemon group, default ^{tt8}$.

数据目录必须是用户或组为pid文件的writer。每个值来自 mqtt-broker存储到它的rrd文件,路径来自主题。例如: /var/lib/mqttorrd/garden/pool/temperature.rrd

[记录]

handler:Python logging handler. Possible values are ^{tt10}$ or ^{tt11}$. When tool is run at foreground, ^{tt12}$ handler is use. On UNIX like systems, WatchedFileHandler is used. Defaults to ^{tt11}$.
syslog:Syslog connection, ^{tt14}$ by default. ^{tt15}$ facility is used.
file:Path to log file if ^{tt10}$ handler is used. Defaults to ^{tt17}$.
level:One of Python logging level: ^{tt18}$. Default value is ^{tt19}$.
format:Logging format. Default value is ^{tt20}$.

[mqtt]

client_id:MQTT client id. If is not defined, it is generate automatically.
hostname:Broker hostname, ^{tt21}$ by default.
port:Broker port, ^{tt22}$ is allways default.
keepalive:The keepalive timeout value for the client. Defaults to ^{tt23}$ seconds.
tls:TLS connection, default ^{tt24}$.
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 ^{tt25}$.

[/]

对于任何主题都可以定义自己的rrd参数。像^{tt26}这样的mqtt字符$ 可以使用+。如果接收到新主题消息,则首先定义, 使用匹配的。如果数据库文件还存在,则只更新值。 有关详细信息,请参见https://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html

step:Round Robin Database step. Defaults to ^{tt23}$ seconds.
DS:Data source definition. Default value is ^{tt29}$, where ^{tt30}$ 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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java无法构建实体管理器工厂JPA/Hibernate   rest服务器设计中的java实现授权   当要发送的请求是多部分请求时,struts2 Spring CSRF令牌不工作   java使用可折叠元素在网格中显示对象   java Huffman树输出错误   在Spring boot中尝试获取Hikari池活动连接时发生java InstanceNotFoundException   java为什么ForkJoinPool使用ThreadPerTaskExecutor?   结果集的java日期相关方法不起作用   java将字节数组转换为大整数:为什么数组输出中有这么多“f”十六进制值?   mysql是否可以将java应用程序及其数据库保存在可移动磁盘中?如果是,怎么做?   java减少对象列表中的整数属性   Eclipse Juno上的java独立OSGi(Equinox)服务器   java使用ANT运行我的应用程序时,找不到XPath实现   java在抽屉菜单中的片段之间切换不起任何作用   是否可以将“Java8方法引用”对象传递给流?   单元测试测试驱动开发,Java,遇到断言错误   java Jsoup登录穆迪