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

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.xdnf.cn/news/5991.html

相关文章:

  • VS Code怎么设置python SDK路径
  • 理解计算机系统_并发编程(5)_基于线程的并发(二):线程api和基于线程的并发服务器
  • Ascend的aclgraph(六)AclConcreteGraph
  • 技术并不能产生一个好的产品
  • solidwors插件 开发————仙盟创梦IDE
  • # YOLOv3:基于 PyTorch 的目标检测模型实现
  • 2.7/Q2,Charls最新文章解读
  • 北三短报文数传终端:筑牢水利防汛“智慧防线”,守护江河安澜
  • 构建你的第一个简单AI助手 - 入门实践
  • LangSmith 基本使用教程
  • 大疆无人机
  • 黑马k8s(五)
  • 面试题总结
  • 实景三维建模软件应用场景(众趣科技实景三维建模)
  • HarmonyOS NEXT应用开发-Notification Kit(用户通知服务)notificationManager.getSlots
  • SEO职业市场正在经历重大变革吗?2025年趋势与应对策略
  • Qt在统信UOS及银河麒麟Kylin系统中进行软件开发的环境配置,打包发布和注意事项
  • P2758 编辑距离
  • 深入理解 OAuth 2.0:技术核心与实战场景
  • java数组题(5)
  • 考研复习全年规划
  • 爬虫Incapsula reese84加密案例:Etihad航空(纯算法)
  • xss-labs靶场基础8-10关(记录学习)
  • 多线程进阶核心知识详解(通俗版)
  • Python+Streamlit实现登录页
  • python-pyqt6框架工具开发总结
  • PostgreSQL 的表连接方法
  • 25.5.13
  • 2025年金融创新、区块链与信息技术国际会议(FRCIT 2025 2025)
  • 深入解析 I/O 模型:原理、区别与 Java 实践