[root@localhost yum.repos.d]# vim zabbix.repo
[zabbix] name=Zabbix Official Repository - $basearch baseurl=http://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/ enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-debuginfo] name=Zabbix Official Repository debuginfo - $basearch baseurl=http://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/debuginfo/ enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591 gpgcheck=0
[zabbix-non-supported] name=Zabbix Official Repository non-supported - $basearch baseurl=http://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/ enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX gpgcheck=0
[root@localhost ~]# systemctl stop firewalld [root@localhost ~]# setenforce 0 [root@localhost ~]# yum -y install zabbix-web-mysql zabbix-server-mysql zabbix-agent mariadb mariadb-server
[root@localhost ~]# systemctl enable mariadb
[root@localhost ~]# systemctl start mariadb
[root@localhost ~]# mysqlMariaDB [(none)]> create database zabbix charset utf8 collate utf8_bin; #数据库字符集和一个数据库校对规则 Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.00 sec) [root@localhost ~]# zcat /usr/share/doc/zabbix-server-mysql-4.4.9/create.sql.gz | mysql -uzabbix -pzabbix zabbix
[root@localhost ~]# vim /etc/zabbix/zabbix_server.conf DBPassword=zabbix 修改时区
[root@localhost ~]# vim /etc/php.ini
date.timezone = Asia/Shanghai
[root@localhost ~]# systemctl start zabbix-server zabbix-agent httpd [root@localhost ~]# netstat -antp | egrep "80|10050|10051"
汉化
主库
从库
测试触发器报警
监控mysql流量
增加监控项
vim /etc/zabbix/zabbix_agentd.d/userparameter_Bytes_sent.conf
1
UserParameter=Bytes_sent[*],/etc/zabbix/scripts/pv_uv.sh $1
vim /etc/zabbix/zabbix_agentd.d/userparameter_Bytes_receive.conf
1
UserParameter=Bytes_receive[*],/etc/zabbix/scripts/pv_uv.sh $1