1、进入zabbix官方网站下载页面
通过网址:https://www.zabbix.com/download, 进入到“Download and install Zabbix”页面,然后选择第1个页签“for production use",即"Install Zabbix from Package";
a. Install Repository with MySQL database(安装官方zabbix server源库)
# rpm -i http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
b. Install Zabbix server, frontend, agent (安装zabbix server、web前端、zabbix agent)
# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
c. Create initial database(创始初始zabbix数据库,这里前提系统已经装好了mysql数据库,不然执行报错)
# mysql -uroot -ppassword (输入数据库中root帐户的密码以认证通过)
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> quit;
(Import initial schema and data. You will be prompted to enter your newly created password,导入初始表与数据。你将会提醒输入你最近创建的zabbix用户的密码)
d. Configure the database for Zabbix server(修改zabbix server配置文件)
e. Configure PHP for Zabbix frontend(修改前端PHP配置文件)
#vi /etc/httpd/conf.d/zabbix.conf
#php_value date.timezone Europe/Riga(将时区Europe/Riga修改为Asia/Shanghai,并且将顶头的#去掉,使其生效)
f. Start Zabbix server and agent processes(启动zabbix-server、zabbix-agent、httpd三个服务并设置为开机自启动)
# systemctl enable zabbix-server zabbix-agent httpd
4、进入zabbix前端网页,并根据页面引导完成前端进一步配置
进入http://server_ip_or_name/zabbix (server_ip_or_name为zabbix server的IP或主机名),根据页面引导完成前端进一步配置,
如果在配置web时提示任何参数不满足安装配置要求,vi /etc/httpd/conf.d/zabbix.conf修改对应参数后重启httpd服务即可
注:需要确保防火墙相关端口和selinux设置得当,不要阻碍前端正常访问。
这里我直接关闭防火墙和selinux,如果不关闭,请参考相关资料做相关正确设置。
1)关闭防火墙(重启失效):iptables -F
2)关闭selinux
#vi /etc/selinux/config 设置SELINUX=disabled