1.安装数据库
shell> yum -y install mariadb mariadb-server mariadb-devel
2.修改登陆密码
shell> mysql_secure_installation
Enter current password for root (enter for none): [回车]Set root password? [Y/n] y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] n
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
3.按照官方文档安装(本文以4.2版本为例)
shell> rpm -ivh https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpm
shell> yum install zabbix-proxy-mysql
shell> mysql -uroot -p<password>
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<password>';
mysql> quit;
shell> zcat /usr/share/doc/zabbix-proxy-mysql*/schema.sql.gz | mysql -uzabbix -p zabbix
4.修改配置文件
shell> vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=<password>
5.安装fping
参见安装fping,安装完成后修改权限及配置文件
shell> chown root:zabbix /usr/local/fping/sbin/fping
shell> chmod 4710 /usr/local/fping/sbin/fping
shell> vi /etc/zabbix/zabbix_proxy.conf
FpingLocation=/usr/local/fping/sbin/fping