Ubuntu 22.04 安装 zabbix
Ubuntu 22.04 安装 zabbix
1,Install Zabbix repository
# wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4+ubuntu22.04_all.deb
# dpkg -i zabbix-release_6.0-4+ubuntu22.04_all.deb
# apt update
2,安装Zabbix server,Web前端,agent
# apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent
3,安装mysql数据库
apt install mysql-server -y
3.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;
3.2 导入初始架构和数据,系统将提示您输入新创建的密码。
# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
3.3 在导入数据库架构后,禁用log_bin_trust_function_creators选项。
# mysql -uroot -p
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
3.4 为Zabbix server配置数据库
vim /etc/zabbix/zabbix_server.conf
DBPassword=password
3.5 为Zabbix前端配置PHP
vim /etc/zabbix/nginx.conf uncomment and set 'listen' and 'server_name' directives
listen 8080;
server_name 域名或者IP地址;
3.6 启动Zabbix server和agent进程
systemctl restart zabbix-server zabbix-agent nginx php8.1-fpm
systemctl enable zabbix-server zabbix-agent nginx php8.1-fpm
4,web访问8080端口
参考
原文地址:https://blog.csdn.net/u010953692/article/details/137717171
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!