一、部署环境
CentOS 7.7 (1908)
Zabbix 4.0 LTS
二、系统环境设置
2.1 添加Zabbix镜像源
rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
2.2 关闭并停用防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
3.3 停用selinux
修改selinux配置文件:/etc/selinux/config
SELINUX=disabled
三、安装服务程序
3.1 安装zabbix 组件
yum install -y zabbix40-server-mysql.x86_64
yum install -y zabbix40-web-mysql.noarch
yum install -y zabbix40-agent.x86_64
3.2 安装并启动mysql
yum install mariadb-server
systemctl start mariadb.server
3.3 创建数据库
mysql -uroot -p
“密码”
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
mysql> quit;
3.4 导入数据库表结构
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
四、修改服务程序配置
4.1 修改zabbix配置信息
编辑:Vim /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=password
4.2 设置PHP环境时区
编辑:/etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
五、重启所有服务,并加入到开机自启动
zabbix-server.service
zabbix-agent.service
httpd.service
mariadb.service
systemctl restart zabbix-server.service zabbix-agent.service httpd.service mariadb.service
systemctl enable zabbix-server.service zabbix-agent.service httpd.service mariadb.service
至此服务器后台部署完成,接下来就是打开web前端配置zabbix服务
浏览器访问:http://服务器IP/zabbix
参考:
官方教程:https://www.zabbix.com/download?zabbix=4.0&os_distribution=centos&os_version=7&db=mysql&ws=apache