1. 选择您Zabbix服务器的平台

https://www.zabbix.com/cn/download 官网可以进行如下的选择,即可显示出相应的yum安装步骤和方法,非常人性化!

Ubuntu下安装 Zabbix 6.0LTS(NGNIX)_Zabbix 6.0LTS


2. Install and configure Zabbix server for your platform

a. Install Zabbix repository
# wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-1+ubuntu20.04_all.deb
# dpkg -i zabbix-release_6.0-1+ubuntu20.04_all.deb
# apt update
b. 安装Zabbix server,Web前端,agent
# apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent
c. 创建初始数据库

Make sure you have database server up and running.

在数据库主机上运行以下代码。

# mysql -uroot -p
password
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;

导入初始架构和数据,系统将提示您输入新创建的密码。

# zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix
d. 为Zabbix server配置数据库

编辑配置文件 /etc/zabbix/zabbix_server.conf

DBPassword=password
e. 为Zabbix前端配置PHP

编辑配置文件 /etc/zabbix/nginx.conf, uncomment and set 'listen' and 'server_name' directives.

# listen 80;
# server_name example.com;
f. 启动Zabbix server和agent进程

启动Zabbix server和agent进程,并为它们设置开机自启:

# systemctl restart zabbix-server zabbix-agent nginx php7.4-fpm
# systemctl enable zabbix-server zabbix-agent nginx php7.4-fpm
g. 配置Zabbix前端

连接到新安装的Zabbix前端: http://server_ip_or_name/

根据Zabbix文件里步骤操作: https://www.zabbix.com/documentation/6.0/zh/manual/installation/frontend