当前位置: 首页 > news >正文

zabbix最新版本7.2超级详细安装部署(一)

如果文章对你有用,请留下痕迹在配置过程中有问题请及时留言,本作者可以及时更新文章

目录

1、提前准备环境

 2、zabbix7.2安装部署

 3、安装并配置数据库

 4、为Zabbix server配置数据库

 5、为Zabbix前端配置PHP

 6、启动Zabbix server和agent进程

7、关闭防火墙访问zabbix

 8、Web界面配置

 9、配置中文界面


1、提前准备环境

最新版本需要在centos9安装部署

官方地址下载Zabbix

[root@localhost ~]# cat /etc/redhat-release
CentOS Stream release 9

 2、zabbix7.2安装部署

rpm -Uvh https://repo.zabbix.com/zabbix/7.2/release/rhel/9/noarch/zabbix-release-latest-7.2.el9.noarch.rpm
dnf clean all#配置zabbix库

 安装Zabbix server,Web前端,agent

centos7包管理是yum,centos9更换成了dnf

 dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
[root@localhost ~]# rpm -qa | grep zabbix-release
zabbix-release-7.2-1.el9.noarch
[root@localhost ~]# rpm -qa | grep zabbix*
zabbix-release-7.2-1.el9.noarch
zabbix-web-7.2.6-release1.el9.noarch
zabbix-web-mysql-7.2.6-release1.el9.noarch
zabbix-web-deps-7.2.6-release1.el9.noarch
zabbix-apache-conf-7.2.6-release1.el9.noarch
zabbix-server-mysql-7.2.6-release1.el9.x86_64
zabbix-sql-scripts-7.2.6-release1.el9.noarch
zabbix-selinux-policy-7.2.6-release1.el9.x86_64
zabbix-agent-7.2.6-release1.el9.x86_64

 3、安装并配置数据库

 dnf install -y mariadb-server mariadb
[root@localhost ~]# systemctl restart mariadb
[root@localhost ~]# netstat -pltun|grep 3306
tcp6       0      0 :::3306                 :::*                    LISTEN      88171/mariadbd
#默认密码 123456
[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.5.27-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> create database zabbix character set utf8mb4 collate utf8mb4_bin;
Query OK, 1 row affected (0.001 sec)
MariaDB [(none)]> create user 'zabbix'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.001 sec)MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.001 sec)MariaDB [(none)]> set global log_bin_trust_function_creators = 1;
Query OK, 0 rows affected (0.000 sec)MariaDB [(none)]> quit
Bye

 导入初始架构和数据,系统将提示您输入新创建的密码。

[root@localhost ~]# ll /usr/share/zabbix/sql-scripts/mysql/server.sql.gz
-rw-r--r--. 1 root root 4082453 Apr 23 14:42 /usr/share/zabbix/sql-scripts/mysql/server.sql.gz
[root@localhost ~]# zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
Enter password:

 验证初始数据是否完成

[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 10.5.27-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> use zabbix;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
MariaDB [zabbix]> show tables;
+----------------------------+
| Tables_in_zabbix           |
+----------------------------+
| acknowledges               |
| actions                    |
| alerts                     |
| auditlog                   |
| autoreg_host               |
| changelog                  |
| conditions                 |
| config                     |
| config_autoreg_tls         |
| connector                  |
| connector_tag              |
| corr_condition             |
| corr_condition_group       |
| corr_condition_tag         |
| corr_condition_tagpair     |
| corr_condition_tagvalue    |
| corr_operation             |

 导入数据库架构后禁用log_bin_trust_function_creators选项。

MariaDB [zabbix]> set global log_bin_trust_function_creators = 0;
Query OK, 0 rows affected (0.000 sec)MariaDB [zabbix]> quit
Bye
[root@localhost ~]#

 4、为Zabbix server配置数据库

[root@localhost ~]# vim  /etc/zabbix/zabbix_server.conf### Option: DBPassword
#       Database password.
#       Comment this line if no password is used.
#
# Mandatory: no
# Default:DBPassword=123456

 5、为Zabbix前端配置PHP

# listen 8080;
# server_name example.com;[root@localhost ~]# vim /etc/nginx/conf.d/zabbix.conf
server {listen          80;server_name     zabbix.com;

 6、启动Zabbix server和agent进程

[root@localhost ~]# systemctl restart zabbix-server zabbix-agent nginx php-fpm
[root@localhost ~]# netstat -pltun
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1434/sshd: /usr/sbi
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      95368/nginx: master
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN      95354/zabbix_agentd
tcp        0      0 0.0.0.0:10051           0.0.0.0:*               LISTEN      95386/zabbix_server
tcp6       0      0 :::22                   :::*                    LISTEN      1434/sshd: /usr/sbi
tcp6       0      0 :::80                   :::*                    LISTEN      95368/nginx: master
tcp6       0      0 :::3306                 :::*                    LISTEN      88171/mariadbd
tcp6       0      0 :::10050                :::*                    LISTEN      95354/zabbix_agentd
tcp6       0      0 :::10051                :::*                    LISTEN      95386/zabbix_server
udp        0      0 127.0.0.1:323           0.0.0.0:*                           756/chronyd
udp6       0      0 ::1:323                 :::*                                756/chronyd
[root@localhost ~]#

7、关闭防火墙访问zabbix

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# systemctl status firewalld
○ firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; preset: enabled)Active: inactive (dead) since Tue 2025-05-13 11:11:39 CST; 3h 41min agoDuration: 1min 52.402sDocs: man:firewalld(1)Main PID: 744 (code=exited, status=0/SUCCESS)CPU: 698msMay 13 11:09:46 localhost systemd[1]: Starting firewalld - dynamic firewall daemon...
May 13 11:09:47 localhost systemd[1]: Started firewalld - dynamic firewall daemon.
May 13 11:11:39 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...
May 13 11:11:39 localhost.localdomain systemd[1]: firewalld.service: Deactivated successfully.
May 13 11:11:39 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@localhost ~]#

 8、Web界面配置

 http://192.168.25.151/setup.php

 根据前面创建的zabbix用户写写入

 初始登录username是 Admin 密码是zabbix

z

 9、配置中文界面

[root@localhost ~]# dnf install -y fontconfig langpacks-zh_CN.noarch
[root@localhost ~]# dnf install -y https://download1.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm
[root@localhost ~]# dnf install -y google-roboto-fonts

 检查是否有中文字体

[root@localhost ~]# rpm -qa | grep google
google-noto-cjk-fonts-common-20230817-2.el9.noarch
google-noto-sans-cjk-ttc-fonts-20230817-2.el9.noarch
google-noto-serif-cjk-ttc-fonts-20230817-2.el9.noarch
google-roboto-fonts-2.138-10.el9.noarch
[root@localhost ~]# fc-list :lang=zh
/usr/share/fonts/google-noto-cjk/NotoSansCJK-DemiLight.ttc: Noto Sans CJK TC,Noto Sans CJK TC DemiLight:style=DemiLight,Regular[root@localhost alternatives]# ln -fs /usr/share/fonts/google-noto-cjk/NotoSansCJK-DemiLight.ttc /etc/alternatives/zabbix-web-ui-font

 10、重启服务

systemctl restart zabbix-server zabbix-agent nginx php-fpm

选择中文语言 

 完成

 

相关文章:

  • Helix QAC 2025.1 重磅发布!MISRA C:2025® 100%覆盖
  • 【C++】【设计模式】生产者-消费者模型
  • 数据库--处理模型(Processing Model)
  • 有限资源下的AI搜索策略:2025年SEO优化指南
  • 在scala中使用sparkSQL读入csv文件
  • 前端面试每日三题 - Day 33
  • Vue 2 和 Vue 3的比较(二、语法差异)
  • 新一代动态可重构处理器技术,用于加速嵌入式 AI 应用
  • 索尼(sony)摄像机格式化后mp4的恢复方法
  • CAElinux系统详解
  • Retrofit vs Feign: 介绍、对比及示例
  • Spring Boot 跨域问题全解:原理、解决方案与最佳实践
  • Java GUI 开发之旅:Swing 组件与布局管理的实战探索
  • EBS 段值安全性配置
  • 【软件测试】第一章·软件测试概述
  • Spring AI 开发本地deepseek对话快速上手笔记
  • 理解计算机系统_并发编程(5)_基于线程的并发(二):线程api和基于线程的并发服务器
  • 正点原子T80烙铁拆解学习
  • 服务器制造业中,L2、L6、L10等表示什么意思
  • iVX 研发基座:大型系统开发的协作与安全架构实践
  • 硅料收储挺价“小作文”发酵光伏板块罕见大涨,知情人士:确实在谈
  • 特朗普访中东绕行以色列,专家:凸显美以利益分歧扩大
  • 北洋“修约外交”的台前幕后——民国条约研究会档案探研
  • 对话郑永年:我们谈判也是为世界争公义
  • 从600名外到跻身大满贯,孙发京:走过的路成就了现在的我
  • 美国政府信用卡被设1美元限额,10美元采购花一两小时填表