环境
- 服务器:Centos 8 Stream
- 版本:6.4
- 组件:Server、Frontend、Agent
- 数据库:PostgreSQL
- Web:Nginx + PHP7.4
安装
- 安装Zabbix依赖
1
2rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/8/x86_64/zabbix-release-6.4-1.el8.noarch.rpm
dnf clean all - 切换PHP版本
1
dnf module switch-to php:7.4
- 安装Server、Web前端和代理
1
dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
- 创建初始数据库
1
2
3
4# Make sure you have database server up and running.
sudo -u postgres createuser --pwprompt zabbix
sudo -u postgres createdb -O zabbix zabbix
zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix - 配置数据库
1
2# Edit /etc/zabbix/zabbix_server.conf
DBPassword=password - 配置PHP
1
2
3# Edit /etc/nginx/conf.d/zabbix.conf uncomment and set 'listen' and 'server_name' directives
listen 8080;
server_name example.com; - 启动Server和Agent进程
1
2systemctl restart zabbix-server zabbix-agent nginx php-fpm
systemctl enable zabbix-server zabbix-agent nginx php-fpm