zabbix5.0监控mysql服务器

9 篇文章 1 订阅
2 篇文章 0 订阅

zabbix5.0监控mysql服务器

hostnameip
zabbix-server10.130.16.10
mysql10.130.16.11

mysql:

#zabbix-agent安装
rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm  	#使用阿里云的
yum clean all
yum install -y zabbix-agent
#创建账户并赋权
[root@mysql ~]# mysql
MariaDB [(none)]> CREATE USER 'zbx_monitor'@'localhost' IDENTIFIED BY '<password>';
MariaDB [(none)]> GRANT USAGE,REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO  'zbx_monitor'@'localhost';
MariaDB [(none)]> flush privileges;


###测试
[root@mysql ~]# mysql -uzbx_monitor -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 11879
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| zabbix             |
+--------------------+
4 rows in set (0.00 sec)
#这个路径通过rpm -ql找到相应的路径
cp /usr/share/doc/zabbix-agent-5.0.7/userparameter_mysql.conf /etc/zabbix/zabbix_agentd.d/template_db_mysql.conf

###   /etc/zabbix/zabbix_agentd.d/template_db_mysql.conf 按实际设置修改 
#[client]
#user=zbx_monitor
#password=<password>

###配置账户
mkdir -p /var/lib/zabbix
cat>/var/lib/zabbix/.my.cnf<<EOF
[client]
user='zbx_monitor'
password='<password>'
EOF

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值