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

选择中文语言 

 完成

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/905338.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

CodeBlocks调试报错

尝试打断点,并且点击红色箭头启动debugger时,控制台报错 Active debugger config: GDB/CDB debugger:Default Building to ensure sources are up-to-date Selecting target: Debug Adding source dir: C:\Users\Lenovo\Desktop\exercise\ Adding source…

Manus 开放注册:AI 智能体领域的新起点

2025 年 5 月 13 日成为了一个具有特殊意义的日子 —— 备受瞩目的 AI 智能体平台 Manus(Manus)正式宣布开放注册。这一消息犹如一颗重磅炸弹,瞬间在全球科技圈引起了广泛关注和热烈讨论。在此之前,Manus 一直以其独特的魅力和极高…

车载网关作为车辆网络系统的核心枢纽

我是穿拖鞋的汉子,魔都中坚持长期主义的汽车电子工程师。 老规矩,分享一段喜欢的文字,避免自己成为高知识低文化的工程师: 钝感力的“钝”,不是木讷、迟钝,而是直面困境的韧劲和耐力,是面对外界…

俄罗斯方块算法2025.5.10

问题描述 俄罗斯方块(Tetris)作为风靡全球38年的现象级益智游戏,其简单易学但难于精通的特性使其成为游戏史上的不朽经典。以下是其核心游戏规则解析及我们的要求: 游戏界面由20行10列的可视区域组成,7种不同形状的四…

Femap许可网络配置

电磁仿真领域,Femap以其卓越的性能和广泛的应用场景,成为众多工程师和科研人员的首选工具。为了满足多用户协作的需求,Femap提供了灵活的网络配置方案。本文将详细介绍Femap许可网络配置的方法和优势,帮助您轻松实现多用户高效协作…

计算机视觉----时域频域在图像中的意义、傅里叶变换在图像中的应用、卷积核的频域解释

1、时域(时间域)——自变量是时间,即横轴是时间,纵轴是信号的变化。其动态信号x(t)是描述信号在不同时刻取值的函数。 2、频域(频率域)——自变量是频率,即横轴是频率,纵轴是该频率信号的幅度,也就是通常说…

主流高防服务器技术对比与AI防御方案实战

1. 高防服务器核心能力对比 当前市场主流高防服务商(如阿里云、腾讯云、华为云)的核心防御能力集中在流量清洗与静态规则防护,但面临以下挑战: 静态防御瓶颈:传统方案依赖预定义规则,对新型攻击&#xff…

常时间运行的程序 导致系统卡顿 自动监控系统CPU和内存利用率 自动选择 内存回收 软件重启 电脑重启

长时间运行安防系统,导致CPU或内存利用率超80%,使得电脑变的缓慢、卡顿的问题。定时获取CPU和内存利用率的数据,在不同时间段(如凌晨与平时),根据利用率的不同的阈值,进行:内存回收(…

OpenCV播放摄像头视频

OpenCV计算机视觉开发实践:基于Qt C - 商品搜索 - 京东 播放摄像头视频和播放视频文件类似,也是通过类VideoCapture来实现,只不过调用open的时候传入的是摄像头的索引号。如果计算机安装了一个摄像头,则open的第一个参数通常是0&…

操作系统:内存管理

目录 1、主要目标 2、核心概念和技术 2.1 物理内存与虚拟内存 2.2 内存分页机制 2.3 页面置换算法 3、监控与性能优化 3.1 查看物理内存 3.2 查看虚拟内存 3.3 性能问题 1> 内存不足(OOM) 2> 内存泄漏 3> 内存碎片 3.4 性能优化策…

专题四:综合练习( 找出所有子集的异或总和再求和)

以leetcode1863题为例 题目分析: 找到每个子集,然后子集中的元素异或之后全部相加 算法原理分析: 画决策树:第一层为这个子集有一个元素 第二层这个子集有两个元素 从上往下罗列,把所有子集都罗列出来&#xf…

【python】—conda新建python3.11的环境报错

1.报错 conda create -n py3.11 python3.11 --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ Collecting package metadata: done Solving environment: failed PackagesNotFoundError: The following packages are not available from current channel…

RabbitMQ事务机制

在RabbitMQ中,生产者为了确保消息发送成功,一种是使用 confirm 确认机制,另一种就是使用事务机制,事务机制就是允许生产者在发送消息时,将多个消息操作作为一个原子单元进行处理,要么所有操作都成功执行&am…

两台笔记本电脑直接通过HDMI线连接?

两台笔记本电脑直接通过HDMI线连接通常无法实现屏幕共享或数据传输,因为HDMI接口设计主要用于单向音视频输出(如连接显示器或电视)。以下是详细分析和替代方案: 为什么HDMI直连两台电脑不适用? 接口功能限制:• 大多数笔记本电脑的…

CentOS 和 RHEL

CentOS 和 RHEL(Red Hat Enterprise Linux)关系非常紧密,简而言之: CentOS 最初是 RHEL 的免费、开源克隆版,几乎与 RHEL 二进制兼容。 CentOS 原是 RHEL 的“免费双胞胎”,但已被放弃,现在推荐…

使用光标测量,使用 TDR 测量 pH 和 fF

时域反射计 (TDR) 是一种通常用于测量印刷电路板 (PCB) 测试试样和电缆阻抗的仪器。TDR 对于测量过孔和元件焊盘的电感和电容、探针尖端电容和电感,甚至寄生电感收发器耦合电容器也非常有用。这也是验证仿真或提取您自…

9.9 Ollama私有化部署Mistral 7B全指南:命令行交互到API集成全流程解析

Ollama私有化部署Mistral 7B全指南:命令行交互到API集成全流程解析 关键词:Ollama 私有化部署, Mistral 7B 运行, 本地大模型管理, 命令行交互, REST API 集成 一、Mistral 7B 模型特性解析 Mistral 7B 是由 Mistral AI 团队开发的高性能开源大语言模型,在同等参数量级模型…

vscode与keil的乱码不兼容问题

都用英文注释 中文注释的话,打开vscode的自动识别格式,如下 解决VSCode中文乱码 自动识别也可以设置识别优先级,把GB2312和UTF8排在自动识别序列前面(因为keil默认就是GB2312) 4.!!!在暂存更改的时候,不要把vscode的设置给暂存了&#xff…

大模型中的KV Cache

1. KV Cache的定义与核心原理 KV Cache(Key-Value Cache)是一种在Transformer架构的大模型推理阶段使用的优化技术,通过缓存自注意力机制中的键(Key)和值(Value)矩阵,避免重复计算&…

Maven 公司内部私服中央仓库搭建 局域网仓库 资源共享 依赖包构建共享

介绍 公司内部私服搭建通常是为了更好地管理公司内部的依赖包和构建过程,避免直接使用外部 Maven 中央仓库。通过搭建私服,团队能够控制依赖的版本、提高构建速度并增强安全性。公司开发的一些公共工具库更换的提供给内部使用。 私服是一种特殊的远程仓…