Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] help doc for mqtt #2645

Merged
merged 2 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions home/docs/help/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ sidebar_label: Help Center
&emsp;&#x1F449;&emsp;[DNS monitoring](dns) <br />
&emsp;&#x1F449;&emsp;[FTP monitoring](ftp) <br />
&emsp;&#x1F449;&emsp;[Websocket monitoring](websocket) <br />
&emsp;&#x1F449;&emsp;[MQTT connection monitoring](mqtt) <br />

### Program monitoring

Expand Down
44 changes: 44 additions & 0 deletions home/docs/help/mqtt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
id: mqtt
title: Monitoring MQTT Connection
sidebar_label: MQTT Connection
keywords: [ Open Source Monitoring System, MQTT Connection Monitoring ]
---

> Monitor MQTT connection status, supporting MQTT5 and MQTT3.1.1 protocols.

**Protocol used: mqtt**

:::tip
To check if topics can be subscribed to normally, HertzBeat will subscribe to a topic and then immediately unsubscribe; to verify if messages can be published correctly, HertzBeat will send a test
message to a topic (if the test message parameter is empty, this check will not be performed).
Please ensure that these operations will not affect your system.
:::

### Configuration Parameters

| Parameter Name | Parameter Description |
|------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| Target Host | The monitored target's IPv4, IPv6, or domain name. Note ⚠️: Do not include protocol headers (e.g., https://, http://). |
| Task Name | The name of this monitoring task, which needs to be unique. |
| Port | The port where the MQTT service is open, default is 1883. |
| Protocol Version | The MQTT protocol version, supporting MQTT5 and MQTT3.1.1. |
| Connection Timeout(ms) | Connection timeout in milliseconds, default is 6000 ms. |
| Client Id | MQTT client ID, default is `hertzbeat-mqtt-client`. |
| Topic | The topic to be monitored. |
| Test Message | Message content used to test whether a topic can be published to normally (optional; if empty, `canPublish` will always be false). |
| Username | MQTT authentication username (optional). |
| Password | MQTT authentication password (optional). |
| Intervals | Interval for periodic data collection, in seconds; the minimum interval that can be set is 30 seconds. |
| Binding Tag | Used for classification and management of monitoring resources. |
| Description | Additional notes to identify and describe this monitoring task, users can leave notes here. |

### Collected Metrics

#### Metric Set: Summary

| Metric Name | Unit | Metric Description |
|--------------|------|---------------------------------------------------------|
| responseTime | none | Response time |
| canPublish | none | Whether messages can be published to the topic normally |
| canSubscribe | none | Whether the topic can be subscribed to normally |
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sidebar_label: 帮助入门
&emsp;&#x1F449;&emsp;[DNS服务器](dns) <br />
&emsp;&#x1F449;&emsp;[FTP服务器](ftp) <br />
&emsp;&#x1F449;&emsp;[Websocket](websocket) <br />
&emsp;&#x1F449;&emsp;[MQTT连接](mqtt) <br />

### 应用程序监控

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
id: mqtt
title: 监控:MQTT 连接
sidebar_label: MQTT 连接
keywords: [ 开源监控系统, MQTT连接监控 ]
---

> 对MQTT连接状态进行监控,支持 MQTT5 和 MQTT3.1.1 协议。

**协议使用:mqtt**

:::tip
为了检测是否可以正常订阅主题,HertzBeat 会订阅主题,然后立即取消订阅;为了检测是否可以正常推送消息,HertzBeat 会推送一条测试消息到主题(如果测试消息参数为空则不作检测)。
请确保这些操作不会对你的系统产生影响。
:::

### 配置参数

| 参数名称 | 参数帮助描述 |
|-----------|---------------------------------------------------------|
| MQTT的Host | 被监控的对端 IPV4,IPV6 或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | MQTT 服务开放端口,默认为1883。 |
| 协议版本 | MQTT 协议版本,支持 MQTT5 和 MQTT3.1.1。 |
| 连接超时时间 | 连接超时时间,单位ms毫秒,默认6000毫秒。 |
| 客户端ID | MQTT 客户端 ID,默认为 `hertzbeat-mqtt-client`。 |
| 主题 | 监控的主题。 |
| 测试消息 | 测试主题是否可以正常推送消息使用的消息内容。(可选,如果为空则 `canPublish` 一直为false ) |
| 用户名 | MQTT 认证用户名(可选)。 |
| 密码 | MQTT 认证密码(可选)。 |
| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 |
| 绑定标签 | 用于对监控资源进行分类管理 |
| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 |

### 采集指标

#### 指标集合:概要

| 指标名称 | 指标单位 | 指标帮助描述 |
|--------------|------|---------------|
| responseTime | 无 | 响应时间 |
| canPublish | 无 | 是否可以正常推送消息到主题 |
| canDescribe | 无 | 主题是否可以正常被订阅 |
3 changes: 2 additions & 1 deletion home/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@
"help/ntp",
"help/dns",
"help/ftp",
"help/websocket"
"help/websocket",
"help/mqtt"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions manager/src/main/resources/define/app-mqtt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ help:
zh-CN: HertzBeat 对 MQTT 连接进行监测。<br>您可以点击 “<i>新建 MQTT 连接</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat monitors MQTT connections. <br>You can click "<i>New MQTT connection</i>" and configure it, or select "<i>More actions</i>" to import an existing configuration.
zh-TW: HertzBeat 對 MQTT 連接進行監測。 <br>您可以點選 “<i>新建 MQTT 連線</i>” 並進行配置,或選擇“<i>更多操作</i>”,匯入已有配置。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/mqtt
en-US: https://hertzbeat.apache.org/docs/help/mqtt
# Input params define for monitoring(render web ui by the definition)
params:
# field-param field key
Expand Down
Loading