Yum安装Zabbix 6.2

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Yum安装Zabbix 6.2相关的知识,希望对你有一定的参考价值。

1. zabbix 6.2 功能组件

Yum安装Zabbix


注意:Almalinux重启网络命令

​nmcli connection reload ens33​

​nmcli connection up ens33​

2. 在AlmaLinux 8 下安装zabbix 6.2

官方文档:​​https://www.zabbix.com/download?zabbix=6.2&os_distributinotallow=alma_linux&os_versinotallow=8&compnotallow=server_frontend_agent&db=mysql&ws=nginx​


准备:关闭selinux和防火墙

setenforce 0

systemctl disable firewalld

systemctl stop firewalld

2.1 Install Zabbix repository

安装Zabbix源

rpm -Uvh https://repo.zabbix.com/zabbix/6.2/rhel/8/x86_64/zabbix-release-6.2-3.el8.noarch.rpm
dnf clean all


2.2 Switch DNF module version for php

切换PHP的DNF模块版本

dnf module switch-to php:7.4

2.3 Install Zabbix server, frontend, agent

安装Zabbix服务器、前端和agent

# dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent

2.4 安装 Marridb(官网未提及的必须步骤)

必须是10.05.00以上版本

vim /etc/yum.repos.d/mariadb.repo

# MariaDB 10.6 CentOS repository list - created 2022-10-26 02:20 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = https://mirrors.aliyun.com/mariadb/yum/10.6/centos8-amd64
module_hotfixes=1
gpgkey=https://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1

dnf makecache


yum -y install mariadb-server mariadb 

systemctl start mariadb.service
systemctl enable mariadb.service
netstat -natp | grep 3306


2.5 Create initial database

创建初始数据库

# mysql -uroot -p
输入数据库密码,默认为空
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by password;
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;


On Zabbix server host import initial schema and data. You will be prompted to enter your newly created password.

导入初始架构和数据

系统将提示您输入新创建的密码 ,密码为上面设置的“password”

zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix


2.6 Disable log_bin_trust_function_creators option after importing database schema.

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

# mysql -uroot -p
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;

2.7 Configure the database for Zabbix server

配置数据库

vim /etc/zabbix/zabbix_server.conf

取消DBPassword=password注释,password改成上面设置的密码“password”

Yum安装Zabbix


Edit file /etc/nginx/conf.d/zabbix.conf uncomment and set listen and server_name directives.

为Zabbix前端配置PHP, 取消掉以下两行的注释

vim /etc/nginx/conf.d/zabbix.conf

listen 8080;
server_name example.com;

2.8 Start Zabbix server and agent processes

启动Zabbix server和agent进程

Start Zabbix server and agent processes and make it start at system boot.

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


3. 配置Zabbix 6.0 前端

3.1 登录zabbix web界面

Yum安装Zabbix


Yum安装Zabbix


Yum安装Zabbix


Yum安装Zabbix


Yum安装Zabbix


Yum安装Zabbix


Yum安装Zabbix

默认用户名密码为Admin/zabbix

以上是关于Yum安装Zabbix 6.2的主要内容,如果未能解决你的问题,请参考以下文章

yum安装zabbix

zabbix2.4 yum安装

CentOS 7 yum安装Zabbix

安装Zabbix到CentOS(YUM)

[原创] zabbix学习之旅二:yum安装

YUM安装Zabbix