$ sudo -s
# wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_6.0+ubuntu22.04_all.deb # dpkg -i zabbix-release_latest_6.0+ubuntu22.04_all.deb # apt update
# apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent
Make sure you have database server up and running.
PS: 在此之前, 手动安装MYSQL数据库和启动服务!!!
d.1 在数据库主机上运行以下代码。
# 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> set global log_bin_trust_function_creators = 1; mysql> quit;
d. 2 导入初始架构和数据,系统将提示您输入新创建的密码。
# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
d.3 Disable log_bin_trust_function_creators option after importing database schema.
# mysql -uroot -p password mysql> set global log_bin_trust_function_creators = 0; mysql> quit;
编辑配置文件 /etc/zabbix/zabbix_server.conf
DBPassword=password
编辑配置文件 /etc/zabbix/nginx.conf uncomment and set 'listen' and 'server_name' directives.
# listen 8080; # server_name example.com;
启动Zabbix server和agent进程,并为它们设置开机自启:
# systemctl restart zabbix-server zabbix-agent nginx php8.1-fpm # systemctl enable zabbix-server zabbix-agent nginx php8.1-fpm
The URL for Zabbix UI when using Nginx depends on the configuration changes you should have made.
本文为宁若水!原创文章,转载无需和我联系,但请注明来自[若水]博客 www.lalaya.net