# 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
安装Zabbix server,Web前端,agent
# apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent
创建初始数据库
#进入mysql对mysql创建用户并进行授权
# mysql -uroot -p
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; #当前主机,远程主机要写主机IP
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;
导入初始架构和数据,系统将提示您输入新创建的密码。
# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
为Zabbix server配置数据库
编辑配置文件 /etc/zabbix/zabbix_server.conf
DBPassword=password
此处如果为远程主机需要修改
DBHost=IPaddr
为Zabbix前端配置PHP
编辑配置文件 /etc/zabbix/nginx.conf uncomment and set 'listen' and 'server_name' directives.
# listen 8080; #这里可以改为80,也可以改为其他端口,防止冲突
# server_name example.com; #此处要改域名,访问IP会跳转到默认页面
启动Zabbix server和agent进程
启动Zabbix server和agent进程,并为它们设置开机自启:
# systemctl restart zabbix-server zabbix-agent nginx php8.1-fpm
# systemctl enable zabbix-server zabbix-agent nginx php8.1-fpm
注:在重启服务之前有一点需要注意,在下载nginx时会连带下载安装apache2,重启服务时apache2也会启动争抢80端口,导致访问失败和一系列问题,需要把apache2禁用掉
systemctl mask apache2.service
**中文及乱码 **
默认为英文,可修改为中文
#CentOS安装中文包,再修改语言,否则无法选择
[root@zabbix-server ~]#yum -y install langpacks-zh_CN
#Ubuntu安装下面中文包
[root@zabbix-server ~]#apt -y install language-pack-zh-hans
需要重启php
标签:Zabbix,set,二进制,zabbix,agent,server,ZABBIX,mysql From: https://www.cnblogs.com/zhangyapeng/p/17484197.html