mosquitto命令参数说明

1. -c  配置文件

从文件中加载配置参数 如果没有指定默认路径为/etc/mosquitto/mosquitto.conf

2. -d   表示以后台守护进程的形式启动

3. -p   指定监听端口 默认为1883

4. -v  监控日志  类似于在配置文件中把log_type 设置为all

mosquitto broker状态监控

客户端可以通过订阅$SYS层级的话题来监控broker的相关信息

1.$SYS/broker/bytes/received  收到的所有字节数

2.$SYS/broker/bytes/sent  发送的所有字节数

3.$SYS/broker/clients/connected 当前在线的客户端数

4.$SYS/broker/clients/expired  超时的连接数

5.$SYS/broker/clients/disconnected 断开的连接数

6.$SYS/broker/clients/maximum  最大并发连接数

7.$SYS/broker/clients/total  所有连接数(活动的和非活动的)

8.$SYS/broker/heap/current size  当前用到的内存

9.$SYS/broker/heap/maximum size  用到的最大内存

$SYS/broker/load/connections/+
The moving average of the number of CONNECT packets received by the broker over different time intervals. The final "+" of the hierarchy can be 1min, 5min or 15min. The value returned represents the number of connections received in 1 minute, averaged over 1, 5 or 15 minutes.

$SYS/broker/load/bytes/received/+
The moving average of the number of bytes received by the broker over different time intervals. The final "+" of the hierarchy can be 1min, 5min or 15min. The value returned represents the number of bytes received in 1 minute, averaged over 1, 5 or 15 minutes.

$SYS/broker/load/bytes/sent/+
The moving average of the number of bytes sent by the broker over different time intervals. The final "+" of the hierarchy can be 1min, 5min or 15min. The value returned represents the number of bytes sent in 1 minute, averaged over 1, 5 or 15 minutes.

$SYS/broker/load/messages/received/+
The moving average of the number of all types of MQTT messages received by the broker over different time intervals. The final "+" of the hierarchy can be 1min, 5min or 15min. The value returned represents the number of messages received in 1 minute, averaged over 1, 5 or 15 minutes.

$SYS/broker/load/messages/sent/+
The moving average of the number of all types of MQTT messages sent by the broker over different time intervals. The final "+" of the hierarchy can be 1min, 5min or 15min. The value returned represents the number of messages send in 1 minute, averaged over 1, 5 or 15 minutes.

$SYS/broker/load/publish/dropped/+
The moving average of the number of publish messages dropped by the broker over different time intervals. This shows the rate at which durable clients that are disconnected are losing messages. The final "+" of the hierarchy can be 1min, 5min or 15min. The value returned represents the number of messages dropped in 1 minute, averaged over 1, 5 or 15 minutes.

$SYS/broker/load/publish/received/+
The moving average of the number of publish messages received by the broker over different time intervals. The final "+" of the hierarchy can be 1min, 5min or 15min. The value returned represents the number of publish messages received in 1 minute, averaged over 1, 5 or 15 minutes.

$SYS/broker/load/publish/sent/+
The moving average of the number of publish messages sent by the broker over different time intervals. The final "+" of the hierarchy can be 1min, 5min or 15min. The value returned represents the number of publish messages sent in 1 minute, averaged over 1, 5 or 15 minutes.

$SYS/broker/load/sockets/+
The moving average of the number of socket connections opened to the broker over different time intervals. The final "+" of the hierarchy can be 1min, 5min or 15min. The value returned represents the number of socket connections in 1 minute, averaged over 1, 5 or 15 minutes.

$SYS/broker/messages/inflight
The number of messages with QoS>0 that are awaiting acknowledgments.

$SYS/broker/messages/received
The total number of messages of any type received since the broker started.

$SYS/broker/messages/sent
The total number of messages of any type sent since the broker started.

$SYS/broker/messages/stored
The number of messages currently held in the message store. This includes retained messages and messages queued for durable clients.

$SYS/broker/publish/messages/dropped
The total number of publish messages that have been dropped due to inflight/queuing limits. See the max_inflight_messages and max_queued_messages options in mosquitto.conf(5) for more information.

$SYS/broker/publish/messages/received
The total number of PUBLISH messages received since the broker started.

$SYS/broker/publish/messages/sent
The total number of PUBLISH messages sent since the broker started.

$SYS/broker/retained messages/count
The total number of retained messages active on the broker.

$SYS/broker/subscriptions/count
The total number of subscriptions active on the broker.

$SYS/broker/timestamp
The timestamp at which this particular build of the broker was made. Static.

$SYS/broker/uptime
The amount of time in seconds the broker has been online.

$SYS/broker/version
The version of the broker. Static.

Wildcard Topic Subscriptions

In addition to allowing clients to subscribe to specific topics, mosquitto also allows the use of two wildcards in subscriptions. + is the wildcard used to match a single level of hierarchy. For example, for a topic of "a/b/c/d", the following example subscriptions will match:

a/b/c/d

+/b/c/d

a/+/c/d

a/+/+/d

+/+/+/+

The following subscriptions will not match:

a/b/c

b/+/c/d

+/+/+

The second wildcard is # and is used to match all subsequent levels of hierarchy. With a topic of "a/b/c/d", the following example subscriptions will match:

a/b/c/d

#

a/#

a/b/#

a/b/c/#

+/b/c/#

The $SYS hierarchy does not match a subscription of "#". If you want to observe the entire $SYS hierarchy, subscribe to $SYS/#.

Note that the wildcards must be only ever used on their own, so a subscription of "a/b+/c" is not valid use of a wildcard. The # wildcard must only ever be used as the final character of a subscription.

Bridges

Multiple brokers can be connected together with the bridging functionality. This is useful where it is desirable to share information between locations, but where not all of the information needs to be shared. An example could be where a number of users are running a broker to help record power usage and for a number of other reasons. The power usage could be shared through bridging all of the user brokers to a common broker, allowing the power usage of all users to be collected and compared. The other information would remain local to each broker.

For information on configuring bridges, see mosquitto.conf(5).

Signals

SIGHUP
Upon receiving the SIGHUP signal, mosquitto will attempt to reload configuration file data, assuming that the -c argument was provided when mosquitto was started. Not all configuration parameters can be reloaded without restarting. See mosquitto.conf(5) for details.

SIGUSR1
Upon receiving the SIGUSR1 signal, mosquitto will write the persistence database to disk. This signal is only acted upon if persistence is enabled.

SIGUSR2
The SIGUSR2 signal causes mosquitto to print out the current subscription tree, along with information about where retained messages exist. This is intended as a testing feature only and may be removed at any time.

Files

/etc/mosquitto/mosquitto.conf
Configuration file. See mosquitto.conf(5).

/var/lib/mosquitto/mosquitto.db
Persistent message data storage location if persist enabled.

/etc/hosts.allow, /etc/hosts.deny

原文地址:https://www.cnblogs.com/orangezs/p/8336974.html

时间: 2024-11-02 14:18:29

mosquitto命令参数说明的相关文章

Hadoop命令参数说明

namenode(hdfs)+jobtracker(mapreduce)可以放在一台机器上,datanode+tasktracker可以在一台机器上,辅助namenode要单独放一台机器,jobtracker通常情况下分区跟datanode一样(目录最好分布在不同的磁盘上,一个目录对应一个磁盘),namenode存储目录需要格式化,datanode存储目录不需要格式化,启动时自动创建 同一个datanode上的每个磁盘上的块不会重复,不同datanode之间的块才可能重复 一些文件的说明: 1.

mosquitto_pub和mosquitto_sub 命令参数说明

mosquitto_pub 命令参数说明 1. -d  打印debug信息 2. -f  将指定文件的内容作为发送消息的内容 3. -h  指定要连接的域名  默认为localhost 4. -i  指定要给哪个clientId的用户发送消息 5. -I  指定给哪个clientId前缀的用户发送消息 6. -m  消息内容 7. -n  发送一个空(null)消息 8. -p  连接端口号 9. -q  指定QoS的值(0,1,2) 10. -t  指定topic 11. -u  指定brok

Java命令参数说明

Java在运行已编译完成的类时,是通过java虚拟机来装载和执行的,java虚拟机通过操作系统命令 JAVA_HOME"bin"java –option 来启动,-option为虚拟机参数,JAVA_HOME为JDK安装路径,通过这些参数可对虚拟机的运行状态进行调整,掌握参数的含义可对虚拟机的运行 模式有更深入理解. 一.查看参数列表: 虚拟机参数分为基本和扩展两类,在命令行中输入JAVA_HOME"bin"java 就可得到基本参数列表, 在命令行输入JAVA_H

(三)Docker命令参数说明

保留

mosquitto 常用命令

原文:https://www.cnblogs.com/smartlife/articles/10182136.html 常用命令 订阅主题 mosquitto_sub -h 192.168.0.1 -p 1883 -u root -P root -t topicname 推送消息 mosquitto_pub -h 192.168.0.1 -p 1883 -u root -P root -t topicname -m "发送的消息内容" mosquitto重启 1.1 查看mosquit

mosquitto在Linux环境下的部署/安装/使用/测试

mosquitto在Linux环境下的部署 看了有三四天的的源码,(当然没怎么好好看了),突然发现对mosquitto的源码有了一点点感觉,于是在第五天决定在Linux环境下部署mosquitto. 使用传统源码安装步骤: 步骤1:http://mosquitto.org/files/source/官网下载源码,放到Linux环境中.解压后,找到主要配置文件config.mk,其中包含mosquitto的安装选项,需要注意的是,默认情况下mosquitto的安装需要OpenSSL(一个强大的安全

Linux的sed命令

一.初识sed 在部署openstack的过程中,会接触到大量的sed命令,比如 # Bind MySQL service to all network interfaces.sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf 那么这条命令是什么意思?接下来介绍sed命令答案自然就揭晓了.二.sed简介 sed:是一个编辑器,是一个强大的文件处理工具. sed作用:用来替换.删除,更新文件中的内容.sed能自动处理一个或多个文件. sed原理:sed

【Docker命令大全】

说明: (1)茶色的字体,代表常用的命令: (2)出现<>,代表变量,使用的时候请替换为具体的值 <image_id>  ,代表镜像id <image_name> ,代表镜像名称 <container_id> ,代表容器id <keyword> ,代表关键字 命令 备注 docker version 查看Docker的版本信息 docker info 查看docker环境信息,如容器数量.镜像数量.镜像存储目录等 docker login 注册或

根据wsimport命令生成webservice客户端

wsimport  -d  d:webservice -keep -verbose http://localhost:8888/ns?wsdl 命令参数说明: -d:生成客户端执行类的class文件的存放目录 -s:生成客户端执行类的源文件的存放目录 -p:定义生成类的包名 -keep 是定是否生成.java的源文件 -verbose显示生成详细的过程