首先yum安装zabbix所需要的环境:
yum install gcc gcc-c++ make mysql-server mysql-devel libcurl-devel net-snmp-devel php php-ldap php-gd php-xml php-mysql php-mbstring php-bcmath httpd fping libevent-devel
然后到zabbix官网下载源码包:
wget https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.4.11/zabbix-3.4.11.tar.gz
创建zabbix用户组跟用户:
groupadd zabbix
useradd -g zabbix zabbix
启动Mysql,创建zabbix数据库和zabbix用户:
systemctl start mysqld
mysql -e 'create database zabbix character set utf8'
mysql -e "grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'"
解压缩zabbix源码包并且编译安装:
tar -zvxf zabbix-3.4.11.tar.gz
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libevent
make install