“Zabbix监控mysql”的版本间的差异
跳到导航
跳到搜索
第3行: | 第3行: | ||
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 = | =2 Copy template_db_mysql.conf = |
2021年10月22日 (五) 07:19的版本
目录
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-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'
see also
mysql monitoring zabbix.com Zabbix5.0 监控MySQL
Zabbix 监控Mysql 主从
qk 他们是监控了很多选项的 而我没空搞这么多
参考
[ ]