安装和配置监控服务器zabbix7.0LTS

一、查看selinux和防火墙的状态

[root@server10 ~]# sestatus (查看SELinux状态)
SELinux status:                 disabled
[root@server10 ~]# systemctl status firewalld(查看防火墙状态)
○ firewalld.service - firewalld - dynamic firewall daemon
     Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; preset: enabled)
     Active: inactive (dead)
       Docs: man:firewalld(1)

二、编辑时间同步配置文件

[root@server10 ~]# vim /etc/chrony.conf (编辑时间同步配置文件)
pool ntp.aliyun.com iburst(同步阿里云时间)

三、运行及保存同步时间

[root@server10 ~]# systemctl enable --now chronyd(启动chronyd并设置开机启动)
Created symlink /etc/systemd/system/multi-user.target.wants/chronyd.service → /usr/lib/systemd/system/chronyd.service.
[root@server10 ~]# 
[root@server10 ~]# chronyc sources -v(运行时间同步)

  .-- Source mode  '^' = server, '=' = peer, '#' = local clock.
 / .- Source state '*' = current best, '+' = combined, '-' = not combined,
| /             'x' = may be in error, '~' = too variable, '?' = unusable.
||                                                 .- xxxx [ yyyy ] +/- zzzz
||      Reachability register (octal) -.           |  xxxx = adjusted offset,
||      Log2(Polling interval) --.      |          |  yyyy = measured offset,
||                                \     |          |  zzzz = estimated error.
||                                 |    |           \
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* 203.107.6.88                  2   6     7     1    +22ms[ +137ms] +/-  278ms
[root@server10 ~]# 
[root@server10 ~]# date(查看时间和日期)
Wed Apr  2 09:52:56 AM CST 2025
[root@server10 ~]# 
[root@server10 ~]# clock -w(将时间和日期保存到系统中)

四、安装zabbix 7.0的数据源

[root@server10 ~]# rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rocky/9/x86_64/zabbix-release-latest-7.0.el9.noarch.rpm(安装zabbix 7.0的数据源)
Retrieving https://repo.zabbix.com/zabbix/7.0/rocky/9/x86_64/zabbix-release-latest-7.0.el9.noarch.rpm
warning: /var/tmp/rpm-tmp.ypnElV: Header V4 RSA/SHA512 Signature, key ID b5333005: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:zabbix-release-7.0-5.el9         ################################# [100%]

五、清空dnf缓存及重新生产dnf缓存

[root@server10 ~]# dnf clean all(清空dnf缓存)
25 files removed
[root@server10 ~]# dnf makecache(重新生产dnf缓存)

六、安装zabbix及其插件

[root@server10 ~]# dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent2(安装zabbix及其插件)

七、安装数据库及启动数据库

[root@server10 ~]# dnf -y install mariadb-server mariadb(安装数据库的服务端和客户端)
[root@server10 ~]# systemctl enable --now mariadb(启动数据库并设置开机启动)
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.

八、数据库的安全设置

[root@server10 ~]# mysql_secure_installation (数据库的安全设置)

九、服务器重命名

十、进入数据库配置

[root@zabbix ~]# mysql(进入数据库)
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 10.5.27-MariaDB MariaDB Server

Copyright (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;(创建一个使用uft8mb4字符集和uft8mb4_bin排序规则的zabbix数据库)
Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> create user zabbix@localhost identified by 'redhat';(创建用户为zabbix,只允许本地登录,认证密码是“redhat”)
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost;(将数据库全授权给zabbix用户只允许本地登录)
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> set global log_bin_trust_function_creators = 1;(放宽mysql对存储函数和触发器创建的安全限制,允许在启用二进制日志的情况下,创建和修改未明确指定安全特性的函数)
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> flush privileges;(刷新授权)
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> exit(退出)

十一、zabbix数据库设置默认字符集

[root@zabbix ~]# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix(将zabbix数据库文件导入zabbix数据库中设置默认字符集utfmb4)
Enter password: redhat

十二、进入数据库进行配置

[root@zabbix ~]# mysql(登录数据库)
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.5.27-MariaDB MariaDB Server

Copyright (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)]> set global log_bin_trust_function_creators = 0;(0是mysql基线配置适用于需要严格保障主从数据一致性的保存环境)
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> quit(退出)

十三、编辑zabbix数据库配置文件

[root@zabbix ~]# vim /etc/zabbix/zabbix_server.conf (编辑zabbix数据库配置文件)
132 DBPassword=redhat(zabbix数据库密码为redhat)

十四、编辑阿帕奇的配置文件

[root@zabbix ~]# vim /etc/httpd/conf/httpd.conf (编辑阿帕奇的配置文件)
47 Listen 8080(监听端口8080)

十五、设置zabbix服务器,zabbix代理,阿帕奇,PHP引擎,启动

[root@zabbix ~]# systemctl enable zabbix-server.service zabbix-agent2.service httpd php-fpm --now(设置zabbix服务器,zabbix代理,阿帕奇,PHP引擎,启动并设置开机启动)

十六、开启防火墙、在防火墙永久添加端口

[root@zabbix ~]# systemctl enable zabbix-server.service zabbix-agent2.service httpd php-fpm --now(设置zabbix服务器,zabbix代理,阿帕奇,PHP引擎,启动并设置开机启动)

[root@zabbix ~]# systemctl enable --now firewalld(开启防火墙并设置开机启动)
Created symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service → /usr/lib/systemd/system/firewalld.service.
Created symlink /etc/systemd/system/multi-user.target.wants/firewalld.service → /usr/lib/systemd/system/firewalld.service.
[root@zabbix ~]# 
[root@zabbix ~]# firewall-cmd --add-port=8080/tcp --permanent(在防火墙永久添加tcp的8080端口)
success
[root@zabbix ~]# firewall-cmd --add-port=10050/tcp --permanent(在防火墙永久添加tcp的8080端口)
10051(zabbix客户机端口)
success
[root@zabbix ~]# firewall-cmd --add-port=3306/tcp --permanent在防火墙永久添加tcp的3306端口)
success

十七、重新加载防火墙

[root@zabbix ~]# firewall-cmd --reload(重新加载防火墙)
success
[root@zabbix ~]# firewall-cmd --list-all(重新加载所有规则)
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens160
  sources: 
  services: cockpit dhcpv6-client ssh
  ports: 8080/tcp 10050/tcp 3306/tcp

十八、本地浏览器登录zabbix测试

十九、上传中文字符集软件包

二十、中文字符集移动到zabbix的fonts字体目录下

[root@zabbix ~]# ls
[root@zabbix ~]# mv simfang.ttf /usr/share/zabbix/assets/fonts/(将中文字符集移动到zabbix的fonts字体目录下)

二十一、进入字体目录

[root@zabbix ~]# cd /usr/share/zabbix/assets/fonts/(进入字体目录)
[root@zabbix fonts]# ls
graphfont.ttf  zabbix-icons.svg  zabbix-icons.woff
simfang.ttf    zabbix-icons.ttf  zabbix-icons.woff2

二十一、把字体由英文变成中文

[root@zabbix fonts]# mv graphfont.ttf graphfont.ttf.bak(将原字符集剪切备份)
[root@zabbix fonts]# 
[root@zabbix fonts]# mv simfang.ttf graphfont.ttf(将简体中文命名成原字符集)

二十二、语言成功改为中文

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇