This is an automated email from the ASF dual-hosted git repository.
zhaoqingran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git
The following commit(s) were added to refs/heads/master by this push:
new 93d8f92165 feat(db): Added support for monitoring the Xugu database
(#3899)
93d8f92165 is described below
commit 93d8f92165a840e79b043f0c6c7f516eddc2d699
Author: zhaoyangplus <[email protected]>
AuthorDate: Fri Dec 12 11:32:40 2025 +0800
feat(db): Added support for monitoring the Xugu database (#3899)
---
.../hertzbeat-collector-basic/pom.xml | 4 +
.../collect/database/JdbcCommonCollect.java | 2 +
.../src/main/resources/define/app-xugu.yml | 306 +++++++++++++++++++++
home/docs/help/xugu.md | 68 +++++
.../current/help/xugu.md | 68 +++++
material/licenses/LICENSE | 1 +
pom.xml | 6 +
7 files changed, 455 insertions(+)
diff --git a/hertzbeat-collector/hertzbeat-collector-basic/pom.xml
b/hertzbeat-collector/hertzbeat-collector-basic/pom.xml
index 549c6f08b6..c43972cda0 100644
--- a/hertzbeat-collector/hertzbeat-collector-basic/pom.xml
+++ b/hertzbeat-collector/hertzbeat-collector-basic/pom.xml
@@ -83,6 +83,10 @@
<groupId>com.dameng</groupId>
<artifactId>DmJdbcDriver18</artifactId>
</dependency>
+ <dependency>
+ <groupId>com.xugudb</groupId>
+ <artifactId>xugu-jdbc</artifactId>
+ </dependency>
<!-- postgresql -->
<dependency>
<groupId>org.postgresql</groupId>
diff --git
a/hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/database/JdbcCommonCollect.java
b/hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/database/JdbcCommonCollect.java
index 5c4a6be6a0..42529c7284 100644
---
a/hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/database/JdbcCommonCollect.java
+++
b/hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/database/JdbcCommonCollect.java
@@ -529,6 +529,8 @@ public class JdbcCommonCollect extends AbstractCollect {
case "mysql", "mariadb" -> "jdbc:mysql://" + host + ":" + port
+ "/" + (jdbcProtocol.getDatabase() == null ? "" :
jdbcProtocol.getDatabase())
+ "?useUnicode=true&characterEncoding=utf-8&useSSL=false";
+ case "xugu" -> "jdbc:xugu://" + host + ":" + port
+ + "/" + (jdbcProtocol.getDatabase() == null ? "" :
jdbcProtocol.getDatabase());
case "postgresql" -> "jdbc:postgresql://" + host + ":" + port
+ "/" + (jdbcProtocol.getDatabase() == null ? "" :
jdbcProtocol.getDatabase());
case "clickhouse" -> "jdbc:clickhouse://" + host + ":" + port
diff --git a/hertzbeat-manager/src/main/resources/define/app-xugu.yml
b/hertzbeat-manager/src/main/resources/define/app-xugu.yml
new file mode 100644
index 0000000000..04d96bb7a1
--- /dev/null
+++ b/hertzbeat-manager/src/main/resources/define/app-xugu.yml
@@ -0,0 +1,306 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# The monitoring type category:service-application service monitoring
db-database monitoring custom-custom monitoring os-operating system monitoring
+category: db
+app: xugu
+# The monitoring i18n name
+name:
+ zh-CN: 虚谷数据库
+ en-US: Xugu DB
+# The description and help of this monitoring type
+help:
+ zh-CN: HertzBeat 使用 <a class='help_module_content'
href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 协议</a> 通过配置
SQL 对 虚谷 数据库的通用性能指标(会话 信息、内存 信息、磁盘 信息)进行采集监控,支持版本为 XuguDB V12。<br>您可以点击“<i>新建
虚谷数据库</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
+ en-US: HertzBeat uses the <a class='help_module_content'
href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'>JDBC protocol</a>
to collect and monitor general performance metrics (session information, memory
information, disk information) for Xugu Database by configuring SQL. It
supports XuguDB V12.
+helpLink:
+ zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/xugu
+ en-US: https://hertzbeat.apache.org/docs/help/xugu
+# Input params define for monitoring(render web ui by the definition)
+params:
+ # field-param field key
+ - field: host
+ # name-param field display i18n name
+ name:
+ zh-CN: 目标Host
+ en-US: Target Host
+ # type-param field type(most mapping the html input type)
+ type: host
+ # required-true or false
+ required: true
+ # field-param field key
+ - field: port
+ # name-param field display i18n name
+ name:
+ zh-CN: 端口
+ en-US: Port
+ # type-param field type(most mapping the html input type)
+ type: number
+ # when type is number, range is required
+ range: '[0,65535]'
+ # required-true or false
+ required: true
+ # default value
+ defaultValue: 5138
+ # field-param field key
+ - field: timeout
+ # name-param field display i18n name
+ name:
+ zh-CN: 查询超时时间(ms)
+ en-US: Query Timeout(ms)
+ # type-param field type(most mapping the html input type)
+ type: number
+ # when type is number, range is required
+ range: '[400,200000]'
+ # required-true or false
+ required: false
+ # hide param-true or false
+ hide: true
+ # default value
+ defaultValue: 6000
+ # field-param field key
+ - field: database
+ # name-param field display i18n name
+ name:
+ zh-CN: 数据库名称
+ en-US: Database Name
+ # type-param field type(most mapping the html input tag)
+ type: text
+ # required-true or false
+ required: false
+ # field-param field key
+ - field: username
+ # name-param field display i18n name
+ name:
+ zh-CN: 用户名
+ en-US: Username
+ # type-param field type(most mapping the html input tag)
+ type: text
+ # when type is text, use limit to limit string length
+ limit: 50
+ # required-true or false
+ required: false
+ # field-param field key
+ - field: password
+ # name-param field display i18n name
+ name:
+ zh-CN: 密码
+ en-US: Password
+ # type-param field type(most mapping the html input tag)
+ type: password
+ # required-true or false
+ required: false
+ # field-param field key
+
+# collect metrics config list
+metrics:
+ # metrics - basic
+ - name: session_information
+ priority: 0
+ i18n:
+ zh-CN: 会话 信息
+ en-US: Session Info
+ # collect metrics content
+ fields:
+ # field-metric name, type-metric type(0-number,1-string), unit-metric
unit('%','ms','MB'), label-whether it is a metrics label field
+ - field: Idle_Connection
+ type: 0
+ label: true
+ i18n:
+ zh-CN: 空闲连接
+ en-US: Idle Connection
+ - field: Active_Connections
+ type: 0
+ i18n:
+ zh-CN: 活跃连接
+ en-US: Active Connections
+ - field: Connection_being_created
+ type: 0
+ i18n:
+ zh-CN: 正在创建的连接
+ en-US: Connection being created
+ - field: Null_Read_Connection
+ type: 0
+ i18n:
+ zh-CN: 空读连接
+ en-US: Null Read Connection
+ - field: Complete_data_input_connection
+ type: 0
+ i18n:
+ zh-CN: 完成数据输入连接
+ en-US: Complete data input connection
+ - field: Other
+ type: 0
+ i18n:
+ zh-CN: 其他
+ en-US: Other
+ protocol: jdbc
+ jdbc:
+ host: ^_^host^_^
+ port: ^_^port^_^
+ platform: xugu
+ # username
+ username: ^_^username^_^
+ # password
+ password: ^_^password^_^
+ # database name
+ database: ^_^database^_^
+ # timeout unit:ms
+ timeout: ^_^timeout^_^
+ queryType: columns
+ # sql
+ sql: SELECT CASE status WHEN 112 THEN 'Idle_Connection' WHEN 114 THEN
'Active_Connections' WHEN 111 THEN 'Connection_being_created' WHEN 113 THEN
'Null_Read_Connection' WHEN 115 THEN 'Complete_data_input_connection' ELSE
'Other' END AS status_type, COUNT(*) AS count FROM sys_sessions GROUP BY
status;
+ # JDBC url
+ url: ^_^url^_^
+
+ - name: Memory
+ priority: 1
+ # collect metrics content
+ i18n:
+ zh-CN: 内存 信息
+ en-US: Memory Info
+ fields:
+ - field: G_MEM
+ type: 0
+ unit: B
+ i18n:
+ zh-CN: 全局内存消耗
+ en-US: Global Memory Consumption
+ - field: CATA_MEM
+ type: 0
+ unit: B
+ i18n:
+ zh-CN: CATALOG内存消耗
+ en-US: CATALOG memory consumption
+ - field: TRAN_MEM
+ type: 0
+ unit: B
+ i18n:
+ zh-CN: 事务内存消耗
+ en-US: Transactional memory consumption
+ - field: NET_MEM
+ type: 0
+ unit: B
+ i18n:
+ zh-CN: 用户连接用内存消耗
+ en-US: Memory consumption for user connections
+ - field: TASK_MEM
+ type: 0
+ unit: B
+ i18n:
+ zh-CN: 任务线程消耗
+ en-US: Task Thread Consumption
+ - field: MSG_MEM
+ type: 0
+ unit: B
+ i18n:
+ zh-CN: 内部通讯消息内存消耗
+ en-US: Internal communication message memory consumption
+ - field: LOCK_MEM
+ type: 0
+ unit: B
+ i18n:
+ zh-CN: 局部锁内存消耗
+ en-US: Local lock memory consumption
+ - field: GLOCK_MEM
+ type: 0
+ unit: B
+ i18n:
+ zh-CN: 全局锁内存消耗
+ en-US: Global lock memory consumption
+ - field: DLCHK_MEM
+ type: 0
+ unit: B
+ i18n:
+ zh-CN: 死锁检测内存消耗
+ en-US: Deadlock detection memory consumption
+ - field: MODI_MEM
+ type: 0
+ unit: B
+ i18n:
+ zh-CN: 变更日志内存消耗
+ en-US: Change Log Memory Consumption
+ - field: PROC_MEM
+ type: 0
+ unit: B
+ i18n:
+ zh-CN: 过程执行机内存消耗
+ en-US: Process Execution Machine Memory Consumption
+ # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp,
sdk
+ protocol: jdbc
+ # the config content when protocol is jdbc
+ jdbc:
+ # jdbc host
+ # jdbchost
+ host: ^_^host^_^
+ # port
+ port: ^_^port^_^
+ # platform name
+ platform: xugu
+ # username
+ username: ^_^username^_^
+ # password
+ password: ^_^password^_^
+ # database name
+ database: ^_^database^_^
+ # timeout unit:ms
+ timeout: ^_^timeout^_^
+ # SQL Query Method:oneRow, multiRow, columns
+ queryType: columns
+ # sql
+ sql: SELECT targ_name,targ_value from sys_monitors where targ_name like
'%MEM';
+ url: ^_^url^_^
+
+ - name: Disk
+ priority: 1
+ i18n:
+ zh-CN: 磁盘 信息
+ en-US: Disk Info
+ fields:
+ - field: DISK_READ_NUM
+ type: 0
+ unit: Times
+ i18n:
+ zh-CN: 数据块磁盘读取次数
+ en-US: Number of data block disk reads
+ - field: DISK_WRITE_NUM
+ type: 0
+ unit: Times
+ i18n:
+ zh-CN: 磁盘写入数据块次数
+ en-US: Number of data blocks written to disk
+ - field: DISK_READ_BYTES
+ type: 0
+ unit: B
+ i18n:
+ zh-CN: 磁盘读取字节数
+ en-US: Disk read bytes
+ - field: DISK_WRITE_BYTES
+ type: 0
+ unit: B
+ i18n:
+ zh-CN: 磁盘写入字节数
+ en-US: Bytes written to disk
+ protocol: jdbc
+ jdbc:
+ host: ^_^host^_^
+ port: ^_^port^_^
+ platform: xugu
+ username: ^_^username^_^
+ password: ^_^password^_^
+ database: ^_^database^_^
+ timeout: ^_^timeout^_^
+ queryType: columns
+ sql: SELECT targ_name,targ_value from sys_monitors where targ_name like
'DISK_%';
+ url: ^_^url^_^
diff --git a/home/docs/help/xugu.md b/home/docs/help/xugu.md
new file mode 100644
index 0000000000..9c61863895
--- /dev/null
+++ b/home/docs/help/xugu.md
@@ -0,0 +1,68 @@
+---
+id: xugu
+title: xuguDB Database Monitoring
+sidebar_label: xugu Database
+keywords: [ Open Source Monitoring System, Open Source Database Monitoring,
xugu Database Monitoring ]
+---
+
+> Collect and monitor common performance metrics of the xugu database.
Supports xuguDB.v12.
+
+### Note: You must add the xugu JDBC driver JAR
+
+- Download the xugu JDBC driver JAR, for example: xugu-jdbc-12.3.5.jar.
<https://mvnrepository.com/artifact/com.xugudb/xugu-jdbc/12.3.5>
+- Copy this JAR file to the `ext-lib` directory under the HertzBeat
installation directory.
+- Restart the HertzBeat service.
+
+### Configuration Parameters
+
+| Parameter Name | Description
|
+|----------------|------------------------------------------------------------------------------|
+| Monitoring Host | The IPv4, IPv6, or domain name of the monitored target. ⚠️
Do not include protocol headers (e.g., https://, http://). |
+| Task Name | The name that identifies this monitoring task. The name
must be unique. |
+| Port | The port exposed by the database, default is 5138.
|
+| Query Timeout | The timeout for SQL queries when no response is received,
in milliseconds. Default is 3000 ms. |
+| Database Name | The database instance name, optional.
|
+| Username | Database connection username.
|
+| Password | Database connection password.
|
+| URL | Database connection URL, optional. If configured, the
database name, username, password and other parameters in the URL will override
the above settings. |
+| Collection Interval | The interval for periodically collecting monitoring
data, in seconds. The minimum configurable interval is 30 seconds. |
+| Enable Detection | Whether to probe and check availability before adding
monitoring. The add/modify operation proceeds only if the probe succeeds. |
+| Description | Additional notes and descriptions for this monitoring,
where users can add remarks. |
+
+### Collected Metrics
+
+#### Metric Set: Session Information
+
+| Metric Name | Unit | Description |
+|--------------------------------|------|-----------------------------|
+| Idle_Connection | N/A | Idle connections |
+| Active_Connections | N/A | Active connections |
+| Connection_being_created | N/A | Connections being created |
+| Null_Read_Connection | N/A | Empty read connections |
+| Complete_data_input_connection | N/A | Connections with completed data
input |
+| Other | N/A | Others |
+
+#### Metric Set: Memory Information
+
+| Metric Name | Unit | Description |
+|------------|------|-------------------------------------|
+| G_MEM | B | Global memory consumption |
+| CATA_MEM | B | CATALOG memory consumption |
+| TRAN_MEM | B | Transaction memory consumption |
+| NET_MEM | B | User connection memory consumption |
+| TASK_MEM | B | Task thread memory consumption |
+| MSG_MEM | B | Internal communication message memory consumption |
+| LOCK_MEM | B | Local lock memory consumption |
+| GLOCK_MEM | B | Global lock memory consumption |
+| DLCHK_MEM | B | Deadlock detection memory consumption|
+| MODI_MEM | B | Change log memory consumption |
+| PROC_MEM | B | Procedure execution engine memory consumption |
+
+#### Metric Set: Disk Information
+
+| Metric Name | Unit | Description |
+|-------------------|------|-------------------------------------|
+| DISK_READ_NUM | Times | Number of disk block read operations |
+| DISK_WRITE_NUM | Times | Number of disk block write operations |
+| DISK_READ_BYTES | B | Number of bytes read from disk |
+| DISK_WRITE_BYTES | B | Number of bytes written to disk |
diff --git
a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/xugu.md
b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/xugu.md
new file mode 100644
index 0000000000..877001a3f1
--- /dev/null
+++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/xugu.md
@@ -0,0 +1,68 @@
+---
+id: xugu
+title: 监控:xuguDB数据库监控
+sidebar_label: xugu数据库
+keywords: [ 开源监控系统, 开源数据库监控, xugu数据库监控 ]
+---
+
+> 对xugu数据库的通用性能指标进行采集监控。支持xuguDB.v12。
+
+### 注意,必须添加 xugu jdbc 驱动 jar
+
+- 下载 xugu jdbc driver jar, 例如 xugu-jdbc-12.3.5.jar.
<https://mvnrepository.com/artifact/com.xugudb/xugu-jdbc/12.3.5>
+- 将此 jar 包拷贝放入 HertzBeat 的安装目录下的 `ext-lib` 目录下.
+- 重启 HertzBeat 服务。
+
+### 配置参数
+
+| 参数名称 | 参数帮助描述 |
+|--------|------------------------------------------------------|
+| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
+| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
+| 端口 | 数据库对外提供的端口,默认为5138。 |
+| 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 |
+| 数据库名称 | 数据库实例名称,可选。 |
+| 用户名 | 数据库连接用户 |
+| 密码 | 数据库连接密码 |
+| URL | 数据库连接URL,可选,若配置,则URL里面的数据库名称,用户名密码等参数会覆盖上面配置的参数 |
+| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 |
+| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 |
+| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 |
+
+### 采集指标
+
+#### 指标集合:会话 信息
+
+| 指标名称 | 指标单位 | 指标帮助描述 |
+|--------------------------------|------|----------|
+| Idle_Connection | 无 | 空闲连接 |
+| Active_Connections | 无 | 活跃连接 |
+| Connection_being_created | 无 | 正在创建的连接 |
+| Null_Read_Connection | 无 | 空读连接 |
+| Complete_data_input_connection | 无 | 完成数据输入连接 |
+| Other | 无 | 其他 |
+
+#### 指标集合:内存 信息
+
+| 指标名称 | 指标单位 | 指标帮助描述 |
+|-----------|------|-------------|
+| G_MEM | B | 全局内存消耗 |
+| CATA_MEM | B | CATALOG内存消耗 |
+| TRAN_MEM | B | 事务内存消耗 |
+| NET_MEM | B | 用户连接用内存消耗 |
+| TASK_MEM | B | 任务线程消耗 |
+| MSG_MEM | B | 内部通讯消息内存消耗 |
+| LOCK_MEM | B | 局部锁内存消耗 |
+| GLOCK_MEM | B | 全局锁内存消耗 |
+| DLCHK_MEM | B | 死锁检测内存消耗 |
+| MODI_MEM | B | 变更日志内存消耗 |
+| PROC_MEM | B | 过程执行机内存消耗 |
+
+#### 指标集合:磁盘 信息
+
+| 指标名称 | 指标单位 | 指标帮助描述 |
+|------------------|------|-----------|
+| DISK_READ_NUM | 次 | 数据块磁盘读取次数 |
+| DISK_WRITE_NUM | 次 | 磁盘写入数据块次数 |
+| DISK_READ_BYTES | B | 磁盘读取字节数 |
+| DISK_WRITE_BYTES | B | 磁盘写入字节数 |
diff --git a/material/licenses/LICENSE b/material/licenses/LICENSE
index cbdcda866a..5fbf69e981 100644
--- a/material/licenses/LICENSE
+++ b/material/licenses/LICENSE
@@ -189,6 +189,7 @@ Apache-2.0 licenses
========================================================================
The following components are provided under the Apache-2.0 License. See
project link for details.
The text of each license is the standard Apache 2.0 license.
+ https://mvnrepository.com/artifact/com.xugudb/xugu-jdbc/12.3.5 Apache-2.0
https://mvnrepository.com/artifact/cn.afterturn/easypoi-spring-boot-starter/4.3.0
Apache-2.0
https://mvnrepository.com/artifact/cn.afterturn/easypoi-web/4.3.0
Apache-2.0
https://mvnrepository.com/artifact/cn.afterturn/easypoi-base/4.3.0
Apache-2.0
diff --git a/pom.xml b/pom.xml
index 5a3904365f..5897eb51b6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -138,6 +138,7 @@
<clickhouse.version>0.4.6</clickhouse.version>
<damengc-driver.version>8.1.2.141</damengc-driver.version>
<postgresql.version>42.5.5</postgresql.version>
+ <xugu-jdbc.version>12.3.5</xugu-jdbc.version>
<h2.version>2.2.224</h2.version>
<taos-jdbcdriver.version>3.0.0</taos-jdbcdriver.version>
<iotdb-session.version>0.13.3</iotdb-session.version>
@@ -403,6 +404,11 @@
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
+ <dependency>
+ <groupId>com.xugudb</groupId>
+ <artifactId>xugu-jdbc</artifactId>
+ <version>${xugu-jdbc.version}</version>
+ </dependency>
<!-- taos-jdbc driver -->
<dependency>
<groupId>com.taosdata.jdbc</groupId>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]