mosquitto命令引數說明
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
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
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28624388/viewspace-1439810/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- mosquitto_pub和mosquitto_sub 命令引數說明UI
- Linux SHELL if 命令引數說明Linux
- Mongodb啟動命令mongod引數說明MongoDB
- mosquitto 引數配置UI
- MySQL mysqldump命令的引數詳細說明MySql
- TOP引數說明
- mysqldump引數說明MySql
- mysqldump 引數說明MySql
- MySQL引數說明MySql
- ABAP-BITMAP的命令引數的使用說明
- gnupg2 2.2.20版本,命令引數說明
- Elasticsearch 引數配置說明Elasticsearch
- kafka 引數配置說明Kafka
- redis 3.0 引數說明Redis
- golden gate 引數說明Go
- oracle引數說明(zt)Oracle
- Oracle Table建立引數說明Oracle
- Oracle Table 建立引數 說明Oracle
- mysqldump引數詳細說明MySql
- Oracle Sequence Cache 引數說明Oracle
- 【MYSQL】MHA引數列表說明MySql
- Mysql JDBC Url引數說明MySqlJDBC
- Nginx的gzip配置引數說明Nginx
- linux常用核心引數說明Linux
- GoldenGate HANDLECOLLISIONS引數使用說明Go
- 【7】JVM引數說明和分析JVM
- 2.--Goldgate常用引數說明Go
- 【MySQL】SemisynchronousReplication配置和引數說明MySql
- Redis配置檔案引數說明Redis
- MySQL CMake引數說明手冊MySql
- mysql innodb相關引數說明MySql
- Goldengate引數簡要說明Go
- 【ASM學習】ASM引數說明ASM
- 編譯引數-ObjC的說明編譯OBJ
- Mysql my.cnf部分引數說明MySql
- Azure Blob (三)引數設定說明
- Spring BcryptPasswordEncorder Log Rounds引數說明Spring
- mysql relay log相關引數說明MySql