“Zabbix监控mysql”的版本间的差异
跳到导航
跳到搜索
(→参考) |
|||
(未显示同一用户的8个中间版本) | |||
第1行: | 第1行: | ||
− | =Install Zabbix agent and MySQL client = | + | =1.Install Zabbix agent and MySQL client = |
* 1. Install Zabbix agent and MySQL client. If necessary, add the path to | * 1. Install Zabbix agent and MySQL client. If necessary, add the path to | ||
the mysql and mysqladmin utilities to the global environment variable PATH. | the mysql and mysqladmin utilities to the global environment variable PATH. | ||
− | == | + | ==centos7 yum install mysql5.7 == |
+ | |||
+ | [[CentOS7 yum安装MySQL5.7]] | ||
<pre> | <pre> | ||
密码查看 | 密码查看 | ||
第10行: | 第12行: | ||
2021-10-22T02:11:26.214298Z 1 [Note] A temporary password is generated for | 2021-10-22T02:11:26.214298Z 1 [Note] A temporary password is generated for | ||
root@localhost: 71p=K-p-mVur | root@localhost: 71p=K-p-mVur | ||
− | </pre> | + | </pre> |
+ | =2 Copy template_db_mysql.conf = | ||
+ | Copy template_db_mysql.conf into the folder with Zabbix agent | ||
+ | configuration (/etc/zabbix/zabbix_agentd.d/ by default). Don't forget to | ||
+ | restart Zabbix agent. | ||
+ | <pre>#或者去网上找也差不多 | ||
+ | cp /usr/share/doc/zabbix-agent-5.0.18/userparameter_mysql.conf /etc/zabbix/zabbix_agentd.d/ | ||
+ | |||
+ | cp /usr/share/doc/zabbix-agent-4.4.10/userparameter_mysql.conf /etc/zabbix/zabbix_agentd.d/ | ||
+ | </pre> | ||
+ | |||
+ | =3. Create a MySQL user for monitoring (<password> at yourdiscretion)= | ||
+ | <pre> | ||
+ | CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY '<password>'; | ||
+ | GRANT REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO | ||
+ | 'zbx_monitor'@'%'; | ||
+ | </pre> | ||
+ | =4. Create .my.cnf in the home directory of Zabbix agent for Linux(/var/lib/zabbix by default ) = | ||
+ | <pre> | ||
+ | mkdir -p /var/lib/zabbix | ||
+ | chown -R zabbix:zabbix /var/lib/zabbix | ||
+ | |||
+ | |||
+ | vi /var/lib/zabbix/.my.cnf | ||
+ | [client] | ||
+ | user='zbx_monitor' | ||
+ | password='<password>' | ||
+ | </pre> | ||
第26行: | 第55行: | ||
# cat /usr/local/src/zabbix-5.0.10/config.log | grep '^.*configure.*--prefix' | # cat /usr/local/src/zabbix-5.0.10/config.log | grep '^.*configure.*--prefix' | ||
+ | =Zabbix 监控Mysql 主从= | ||
+ | qk 他们是监控了很多选项的 而我没空搞这么多 | ||
+ | =参考= | ||
+ | |||
+ | [https://www.cnblogs.com/dyjey/p/15030153.html zabbix 5.0监控MySQL-2022] | ||
+ | |||
+ | [https://www.zabbix.com/cn/integrations/mysql#mysql_agent mysql monitoring zabbix.com] | ||
− | |||
[https://blog.csdn.net/zhen1819/article/details/116058706 Zabbix5.0 监控MySQL] | [https://blog.csdn.net/zhen1819/article/details/116058706 Zabbix5.0 监控MySQL] | ||
+ | https://www.zabbix.com/documentation/current/manual/config/templates_out_of_the_box/zabbix_agent | ||
− | |||
− | |||
− | |||
[http://blog.sctux.com/?p=396 zabbix 监控mysql状态以及mysql主从] | [http://blog.sctux.com/?p=396 zabbix 监控mysql状态以及mysql主从] | ||
+ | |||
+ | |||
+ | [https://blog.csdn.net/qq_45939993/article/details/116853593 Zabbix自动化监控——监控MySQL] | ||
[ ] | [ ] | ||
+ | |||
+ | [https://www.codeleading.com/article/941015593/ zabbix自定义key监控mysql ] | ||
[http://lihuipeng.blog.51cto.com/3064864/1081562 Zabbix 监控Mysql 主从状态(Python脚本] | [http://lihuipeng.blog.51cto.com/3064864/1081562 Zabbix 监控Mysql 主从状态(Python脚本] |
2022年10月17日 (一) 05:49的最新版本
目录
1.Install Zabbix agent and MySQL client
* 1. Install Zabbix agent and MySQL client. If necessary, add the path to the mysql and mysqladmin utilities to the global environment variable PATH.
centos7 yum install mysql5.7
密码查看 grep "password" /var/log/mysqld.log 2021-10-22T02:11:26.214298Z 1 [Note] A temporary password is generated for root@localhost: 71p=K-p-mVur
2 Copy template_db_mysql.conf
Copy template_db_mysql.conf into the folder with Zabbix agent
configuration (/etc/zabbix/zabbix_agentd.d/ by default). Don't forget to restart Zabbix agent.
#或者去网上找也差不多 cp /usr/share/doc/zabbix-agent-5.0.18/userparameter_mysql.conf /etc/zabbix/zabbix_agentd.d/ cp /usr/share/doc/zabbix-agent-4.4.10/userparameter_mysql.conf /etc/zabbix/zabbix_agentd.d/
3. Create a MySQL user for monitoring (<password> at yourdiscretion)
CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY '<password>'; GRANT REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zbx_monitor'@'%';
4. Create .my.cnf in the home directory of Zabbix agent for Linux(/var/lib/zabbix by default )
mkdir -p /var/lib/zabbix chown -R zabbix:zabbix /var/lib/zabbix vi /var/lib/zabbix/.my.cnf [client] user='zbx_monitor' password='<password>'
上次居然看不懂官方的 ,看来英文近来是提升了一点点呀
注意
使用Zabbix自带模板监控MySQL时,Zabbix Server编译时需要使用“--with-libxml2”加入“libxml2”库。如果没有,需要重新编译Zabbix Server并重启。在CentOS中,可以通过“yum -y install libxml2 libxml2-devel”安装“libxml2”库。 通过Zabbix源码目录中的“config.log”文件查看编译选项:
- cat /usr/local/src/zabbix-5.0.10/config.log | grep '^.*configure.*--prefix'
Zabbix 监控Mysql 主从
qk 他们是监控了很多选项的 而我没空搞这么多
参考
https://www.zabbix.com/documentation/current/manual/config/templates_out_of_the_box/zabbix_agent
[ ]