Monitoring DBLE with Zabbix: Environment Setup, Scripts, and Template Configuration
This guide explains how to set up a monitoring environment for the DBLE distributed middleware using Zabbix, covering host and software configuration, MySQL master‑slave deployment, DBLE installation, Zabbix script creation, and template configuration with detailed code examples.
1. Introduction to DBLE
DBLE is an enterprise‑grade open‑source distributed middleware; this article shows how to monitor its runtime status and related parameters with Zabbix.
2. Environment Configuration
1. Host Information
Host Name
Roles
IP Address
dble
dble zabbix-agentd
172.22.0.58
mysql-001
mysql-master
172.22.0.7
mysql-002
msysql-slave
172.22.0.52
2. Software Information
Component
Version
dble
actiontech-dble-2.19.11.0
mysql
msysql5.7.26
zabbix-agent
3.0
3. Environment Setup
1. Build MySQL master‑slave
Reference: https://www.cnblogs.com/zyxnhr/p/11141234.html
2. Deploy DBLE
Reference: https://www.jianshu.com/p/cd5911058c66 or the official documentation for read/write splitting.
3. Deploy Zabbix monitoring
Reference: https://www.zabbix.com/
4. Zabbix Scripts
1. DBLE monitoring items
dble.status – includes dble_version, dble_up, front_conn, etc.
dble.mysql_type – backend database type (RW)
dble.mysql_active – backend database health
mysql_read_load – read load count
mysql_write_load – write load count
mysql_execute – execute count
2. Zabbix configuration file
[root@vm-11c-02gt4 xm_external]# cat zbx_xm_external_dble.conf
UserParameter=hfy.xm_external.dble.status[*],sh /data/sh/zabbix_scripts/xm_external/dble/xm_external_dble.sh $1
UserParameter=hfy.xm_external.dble.datasource,sh /data/sh/zabbix_scripts/xm_external/dble/xm_external_dble_datasource.sh data_source
UserParameter=hfy.xm_external.dble.mysql_type[*],sh /data/sh/zabbix_scripts/xm_external/dble/xm_external_dble_datasource.sh mysql_type $1
UserParameter=hfy.xm_external.dble.mysql_active[*],sh /data/sh/zabbix_scripts/xm_external/dble/xm_external_dble_datasource.sh mysql_active $1
UserParameter=hfy.xm_external.dble.mysql_read_load[*],sh /data/sh/zabbix_scripts/xm_external/dble/xm_external_dble_datasource.sh mysql_read_load $1
UserParameter=hfy.xm_external.dble.mysql_write_load[*],sh /data/sh/zabbix_scripts/xm_external/dble/xm_external_dble_datasource.sh mysql_write_load $1
UserParameter=hfy.xm_external.dble.mysql_execute[*],sh /data/sh/zabbix_scripts/xm_external/dble/xm_external_dble_datasource.sh mysql_execute $13. Zabbix script files
[root@vm-11c-02gt4 dble]# cat xm_external_dble.sh $1
#!/bin/bash
# Description: Collect basic DBLE data via its management address
DBLE_USER='man1'
DBLE_PASS='654321'
DBLE_HOST='127.0.0.1'
DBLE_PORT='9066'
dble_conn="mysql -P${DBLE_PORT} -h${DBLE_HOST} -u${DBLE_USER} -p${DBLE_PASS}"
case $1 in
dble_version)
result=`${dble_conn} 2>/dev/null -BNe "show @@version" |grep dble|awk -F - '{print $3}'`
echo $result
;;
dble_up)
${dble_conn} 2>/dev/null -BNe "show @@version"|echo $?
;;
front_conn)
result=`${dble_conn} 2>/dev/null -BNe "show @@connection" |grep 8066 | wc -l`
echo $result
;;
esac [root@vm-11c-02gt4 dble]# cat xm_external_dble_datasource.sh
#!/bin/bash
# Description: Collect DBLE datasource information
DBLE_USER='man1'
DBLE_PASS='654321'
DBLE_HOST='127.0.0.1'
DBLE_PORT='9066'
program_exists() {
mysql_command=`command -v mysql`
if [ -z ${mysql_command} ]; then
rpm -ivh https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
yum -y install mysql-community-client.x86_64
fi
}
dble_conn="mysql -P${DBLE_PORT} -h${DBLE_HOST} -u${DBLE_USER} -p${DBLE_PASS}"
# Functions for each metric (dble_datasouce, dble_mysql_type, etc.) ...
# ... (omitted for brevity) ...
case $1 in
data_source) dble_datasouce ;;
mysql_type) dble_mysql_type $2 ;;
mysql_active) dble_mysql_active $2 ;;
mysql_read_load) dble_mysql_read $2 ;;
mysql_write_load) dble_mysql_write $2 ;;
mysql_execute) dble_mysql_execute $2 ;;
esac5. Zabbix Template Configuration
1. Add application set and items
(Images illustrating the steps are omitted in this text version.)
2. Add automatic discovery
(Images omitted.)
3. Add item prototypes
(Images omitted.)
6. Apply Template to Host and Test
After linking the template to the DBLE host, you can view backend database types and other metrics in the Zabbix UI.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Aikesheng Open Source Community
The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
