Zabbix 7.0 LTS版本于2024年6月4日正式发布,自2022年2月15日Zabbix 6.0 LTS版本发布以来,历时838天发布全新长周期支持版本,为用户带来了一系列创新功能和显著性能提升。新特性包括合成终端用户网页监控,增强Zabbix Proxy的高可用性和负载均衡能力,实现主要性能和可扩展性的飞跃,支持原生多因素认证(MFA)以提升安全性,以及推出新的数据可视化方式,以帮助用户更高效、更安全地监控和管理IT基础设施。
Zabbix 7.0 lts 新特性
01 合成终端用户网页监控
02 Zabbix proxy 高可用性和负载均衡
03 更快更高效的Zabbix proxy
04 更快的数据采集速度和更强的可扩展性
05 集中控制数据采集超时
06 新的数据可视化方式
07 动态仪表盘小部件导航
08 支持企业级多因素认证
09 更灵活的资源发现和管理
10 新模板和集成
Zabbix 7.0 lts 知识文档
Zabbix7.0 新功能介绍
【https://www.zabbix.com/whats_new_7_0】
Zabbix7.0 软件包下载
【https://www.zabbix.com/download】
Zabbix7.0 文档手册
【https://www.zabbix.com/documentation/7.0/en/manual】
平台安装环境,采用 All-In-One 方式
UOS Server 20 (1070a)、PHP 8.0.27、MySQL 8.0.30、Nginx 1.23
系统版本信息
cat /etc/os-release
PRETTY_NAME="UOS Server 20"
NAME="UOS Server 20"
VERSION_ID="20"
VERSION="20"
ID=uos
HOME_URL="https://www.chinauos.com/"
BUG_REPORT_URL="https://bbs.chinauos.com/"
VERSION_CODENAME=kongzi
PLATFORM_ID="platform:uelc20"
系统内核版本
uosinfo
#################################################
Release: UOS Server release 20 (kongzi)
Kernel : 5.10.0-74.uelc20.x86_64
Build : UOS Server 20 (1070a) 20240423 amd64
#################################################
MySQL 部署
1,安装mysql
dnf install mysql mysql-server
2,启动数据库
systemctl start mysqld
3,初始化数据库
mysql_secure_installation
4,登录测试
mysql -uroot -p
5,创建zabbix数据库,创建用户并授权
登录数据库
mysql -uroot -p
创建zabbix 数据库
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
创建zabbix 用户
mysql> create user 'zabbix'@'%' identified by 'password';
授权主机访问
mysql> grant all privileges on zabbix.* to 'zabbix'@'%';
开启log_bin_trust_function_creators
mysql> SET GLOBAL log_bin_trust_function_creators = 1;
刷新策略
flush privileges;
编译安装Zabbix7.0 lts
1,创建zabbix用户组
groupadd --system zabbix
useradd --system -g zabbix -d /usr/lib/zabbix -s /sbin/nologin -c "Zabbix Monitoring System" zabbix
2,创建用户家目录
mkdir -m u=rwx,g=rwx,o= -p /usr/lib/zabbix
chown zabbix:zabbix /usr/lib/zabbix
3,安装依赖环境
dnf install gcc libxml2 libxml2-devel net-snmp net-snmp-devel OpenIPMI OpenIPMI-devel libevent libevent-devel curl curl-devel libssh2-devel java-11-openjdk java-11-openjdk-devel mysql-devel unixODBC-devel openldap openldap-devel pcre pcre-devel fping -y
4,下载Zabbix7.0 lts源码包
wget https://cdn.zabbix.com/zabbix/sources/stable/7.0/zabbix-7.0.0.tar.gz
tar -zvxf zabbix-7.0.0.tar.gz -C /opt && cd /opt/zabbix-7.0.0/
5,导入Zabbix数据库
cd /opt/zabbix-7.0.0/database/mysql
mysql --default-character-set=utf8mb4 -uzabbix -p zabbix < schema.sql
mysql --default-character-set=utf8mb4 -uzabbix -p zabbix < images.sql
mysql --default-character-set=utf8mb4 -uzabbix -p zabbix < data.sql
6,编译安装zabbix_server
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --enable-java --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-unixodbc --with-openipmi --enable-ipv6 --with-openssl --with-ssh2 --with-iconv --with-libpcre --with-iconv-include --with-iconv-lib --with-libevent --with-libevent-include --with-zlib --with-zlib-include --with-zlib-lib --with-libpthread --with-libpthread-include --with-libpthread-lib --with-libevent-lib --with-ldap
make install
7,Zabbix Server 配置文件
egrep -v "*#|^$" /usr/local/zabbix/etc/zabbix_server.conf
LogFile=/tmp/zabbix_server.log
DBHost=127.0.0.1
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix@passwd
Timeout=4
LogSlowQueries=3000
StatsAllowedIP=127.0.0.1
EnableGlobalScripts=0
8, systemctl 服务启动管理
(1) zabbix server
vim /usr/lib/systemd/system/zabbix-server.service
[Unit]
Description=Zabbix Server
After=syslog.target
After=network.target
[Service]
Environment="CONFFILE=/usr/local/zabbix/etc/zabbix_server.conf"
EnvironmentFile=-/usr/local/zabbix
Type=forking
#PIDFile=/var/run/zabbix/zabbix_server.pid
PIDFile=/tmp/zabbix_server.pid
ExecStart=/usr/local/zabbix/sbin/zabbix_server -c /usr/local/zabbix/etc/zabbix_server.conf
ExecStop=/usr/bin/kill $MAINPID
Restart=always
RestartSec=5
User=zabbix
Group=zabbix
[Install]
WantedBy=multi-user.target
(2) zabbix agentd
vim /usr/lib/systemd/system/zabbix-agent.service
[Unit]
Description=Zabbix Agent
After=syslog.target
After=network.target
[Service]
Environment="CONFFILE=/usr/local/zabbix/etc/zabbix_agentd.conf"
EnvironmentFile=-/usr/local/zabbix
Type=forking
PIDFile=/tmp/zabbix_agentd.pid
#PIDFile=/var/run/zabbix/zabbix_agentd.pid
ExecStart=/usr/local/zabbix/sbin/zabbix_agentd -c /usr/local/zabbix/etc/zabbix_agentd.conf
ExecStop=/usr/bin/kill $MAINPID
Restart=always
RestartSec=5
User=zabbix
Group=zabbix
[Install]
WantedBy=multi-user.target
9,设置开机自动启动
systemctl start zabbix-server && systemctl enable zabbix-server
systemctl start zabbix-agent && systemctl enable zabbix-agent
Zabbix 系统环境变量
vim /etc/profile
export PATH=/usr/local/zabbix/sbin:/usr/local/zabbix/bin:$PATH
重载系统变量
source /etc/profile
Nginx 安装
1,查看nginx软件包版本
dnf module list nginx
2,重置nginx模块
dnf module reset nginx
3,切换nginx模块
dnf module enable nginx:1.23
4,安装nginx 软件包
dnf install nginx
5,上传zabbix.conf 文件配置到/etc/nginx/conf.d/
PHP 安装
1,查看php软件包版本
dnf module list php
2,重置php模块
dnf module reset php
3,切换php模块
dnf module switch-to php:8.0
4,安装php软件包
dnf install php php-fpm php-mysqlnd php-cli php-curl php-gd php-mbstring php-xml php-bcmath php-ldap
5,上传zabbix-php-fpm.conf文件配置到/etc/php-fpm.d
服务启动、开机启动
systemctl start php-fpm && systemctl enable php-fpm
systemctl start nginx && systemctl enable nginx
systemctl restart zabbix-server && systemctl enable zabbix-server
Zabbix Web 前端配置文件
拷贝Zabbix web ui 配置文件到/usr/share/zabbix目录下
cp -rp /opt/zabbix-7.0.0/ui /usr/share/zabbix
chown -R nginx:nginx /usr/share/zabbix/
Firewall 防火墙
firewall-cmd --add-port=8080/tcp --permanent
firewall-cmd --reload
Zabbix Web 初始化
http:// server_ip_or_name
Zabbix Web 页面中文显示
Users settings--Profile--Language--Chinese(zh_CN)
Zabbix7.0 Web UI 中文乱码
在Windows 系统中找到 C:\Windows\Fonts 中的楷体(常规)复制到 windows 桌面上,通过lrzsz 上传到 /usr/share/zabbix/assets/fonts 目录下
cd /usr/share/zabbix/assets/fonts
cp DejaVuSans.ttf DejaVuSans.ttf.bak
mv simkai.ttf DejaVuSans.ttf
chmod 755 DejaVuSans.ttf
Zabbix7.0 lts 仪表盘