Monitor galera Cluster via zabbix:
Download URL:
http://share.zabbix.com/databases/mysql/galera-cluster-monitoring
The userparameter_galera.conf inside is for Cluster, App-Galera_Cluster.xml is to be imported into zabbix server template
Cluster node:
cp userparameter_galera.conf /etc/zabbix/zabbix_agentd.d/
mkdir /var/lib/zabbix
vi /var/lib/zabbix/.my.cnf
[mysql]
host=localhost
user=zabbix
password=xxxxx
:wq
mysql -u root -p'xxxx'
grant select on . to zabbix@'localhost' identified by 'xxxx';
flush privileges;
quit
vi /etc/my.cnf (if it is mysql 5.7, you need to enable the following parameters)
show_compatibility_56=on
:wq
systemctl restart mysqld
systemctl restart zabbix-agent
verification:
zabbix_agentd -t "galera.cluster_status"
zabbix_agentd -t "galera.cluster_size" (will display the number of cluster nodes)
zabbix server:
Import App-Galera_Cluster.xml to the template, and then add the Cluster node to the corresponding template