CentOS8部署Zabbix

一、系统修改

1)永久关闭防火墙.

#systemctl disable --now firewalld

2)关闭selinux

#sed -i s/SELINUX=enforcing/SELINUX=disabled/ /etc/selinux/config

二、安装Zabbix

#rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/8/x86_64/zabbix-release-6.4-1.el8.noarch.rpm

#dnf clean all

#dnf module switch-to php:7.4

三、安装Zabbix server,web,agent

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

四、安装数据库Mariadb10.5以上(Zabbix6.0所需)

#vi /etc/yum.repos.d/MariaDB.repo

mariadb

name = MariaDB

baseurl = https://mirrors.aliyun.com/mariadb/yum/10.5/centos8-amd64

module_hotfixes=1

gpgkey=https://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDB

gpgcheck=1

安装数据库.

#dnf install MariaDB-server

启动数据库,加入开机自启

#systemctl start mariadb

#systemctl enable mariadb

五、创建并且初始化数据库

#mysql -uroot -p

password

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

root@boco201 mysql# mysql -uroot -p

Enter password:

Welcome to the MariaDB monitor. Commands end with ; or \g.

Your MariaDB connection id is 12

Server version: 10.5.23-MariaDB MariaDB Server

Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB (none)> drop database zabbix

-> ;

Query OK, 186 rows affected (2.776 sec)

MariaDB (none)> drop user zabbix@localhost;

Query OK, 0 rows affected (0.014 sec)

MariaDB (none)> create database zabbix character set utf8mb4 collate utf8mb4_bin;

Query OK, 1 row affected (0.004 sec)

MariaDB (none)> create user zabbix@localhost identified by 'password';

Query OK, 0 rows affected (0.003 sec)

MariaDB (none)> grant all privileges on zabbix.* to zabbix@localhost;

Query OK, 0 rows affected (0.004 sec)

MariaDB (none)> set global log_bin_trust_function_creators = 1;

Query OK, 0 rows affected (0.002 sec)

六、导入初始架构和数据

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

七、Disable log_bin_trust_function_creators option after importing database schema.

#mysql -uroot -p

password

mysql> set global log_bin_trust_function_creators = 0;

mysql> quit

八、为Zabbix server配置数据库

编辑配置文件 /etc/zabbix/zabbix_server.conf

DBPassword=password

九、启动Zabbix server和agent进程,设置开机自启

#systemctl restart zabbix-server zabbix-agent httpd php-fpm

#systemctl enable zabbix-server zabbix-agent httpd php-fpm

十、首页

http://host/zabbix

十一、其他

10051是zabbix server的端口,10050是anget的端口,3306是Mariadb的端口,80是http的端口

netstat -lntp

默认用户名是Admin,密码是zabbix

相关推荐
数智工坊5 小时前
机器人运动控制:采样、优化与学习三大流派深度对比与实战
android·学习·机器人
故渊at7 小时前
第二板块:Android 四大组件标准化学理 | 第八篇:Service 后台执行实体与优先级
android·gitee·service·前台服务·后台服务
会Tk矩阵群控的小木7 小时前
安卓群控系统对于游戏工作室实战教程
android·运维·游戏·adb·开源软件·个人开发
qeen878 小时前
【C++】类与对象之类的默认成员函数(二)
android·c语言·开发语言·c++·笔记·学习
故渊at8 小时前
第二板块:Android 四大组件标准化学理 | 第九篇:BroadcastReceiver 事件分发与有序广播
android·gitee·broadcast·广播·动态注册·静态注册
JohnnyDeng949 小时前
【Android】Room 数据库高级用法与性能调优:从查询瓶颈到毫秒级响应
android·性能优化·kotlin·room
zeqinjie9 小时前
Flutter 折叠屏 iPad / 宽屏适配实践
android·前端·flutter
ab_dg_dp9 小时前
Android 17+ 提取 AIDL 生成 Java 文件的实用脚本
android·java·python
Arrom10 小时前
DLNA 渲染端排障实战:从 20s 卡顿到 stale subscriber 的两周追凶之旅
android·java