sudo apt update && sudo apt upgrade
# wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb
# dpkg -i zabbix-release_5.0-1+focal_all.deb
# sudo apt update && sudo apt upgrade
# sudo apt install -y zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent mysql-server
Check all the software versions you have installed. Here you can check the supported versions
sudo mysql -V
sudo apache2 -V
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://repo.zabbix.com/zabbix/5.0/ubuntu focal InRelease' doesn't support architecture 'i386'
更改zabbix.list文件,在deb后面添加【arch=amd64】
cd /etc/apt/sources.list.d
vim zabbix.list
sudo php --version
# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_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-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Verify the schema is imported successfully to database zabbix.
sudo mysql -u root -p
use zabbix;
show tables;
quit;
编辑配置文件 /etc/zabbix/zabbix_server.conf
vi /etc/zabbix/zabbix_server.conf
DBPassword=password
编辑配置文件 /etc/zabbix/apache.conf, uncomment and set the right timezone for you.
# php_value date.timezone Europe/Riga 替换为
# php_value date.timezone Asia/Shanghai
启动Zabbix server和agent进程,并为它们设置开机自启
# systemctl restart zabbix-server zabbix-agent apache2
# systemctl enable zabbix-server zabbix-agent apache2
连接到新安装的Zabbix前端: http://server_ip_or_name/zabbix
The default credentials are as follows:
Username: Admin
Password: zabbix
参考链接
https://www.zabbix.com/cn/download?zabbix=5.0&os_distribution=ubuntu&os_version=20.04_focal&db=mysql&ws=apache
https://blog.masteringmdm.com/zabbix-installation-on-ubuntu-server/