From db8c28a1dc81d0631034e800e2cc45edc7c61b10 Mon Sep 17 00:00:00 2001 From: TT Date: Tue, 30 Jul 2024 11:45:56 +0000 Subject: [PATCH] =?UTF-8?q?add=20caselibrary/openEuler-22.03-LTS=E5=AE=89?= =?UTF-8?q?=E8=A3=85zabbix=E6=95=99=E7=A8=8B.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: TT (cherry picked from commit b142c4904bca3d7179960f5273f1c0a86409672c) --- ...350\243\205zabbix\346\225\231\347\250\213" | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 "caselibrary/openEuler-22.03-LTS\345\256\211\350\243\205zabbix\346\225\231\347\250\213" diff --git "a/caselibrary/openEuler-22.03-LTS\345\256\211\350\243\205zabbix\346\225\231\347\250\213" "b/caselibrary/openEuler-22.03-LTS\345\256\211\350\243\205zabbix\346\225\231\347\250\213" new file mode 100644 index 000000000..63ede4490 --- /dev/null +++ "b/caselibrary/openEuler-22.03-LTS\345\256\211\350\243\205zabbix\346\225\231\347\250\213" @@ -0,0 +1,104 @@ +1. ## **OpenEuler 最小安装** + + ##### 关闭防火墙 + + ```text + systemctl stop firewalld + systemctl disable firewalld + ``` + +2. ## **MYSQL服务安装配置** + + 安装mysql + + ```text + dnf install mysql mysql-server mysql-common mysql-libs mysql-devel mysql-selinux --nogpgcheck + ``` + + 启动mysql服务 + + ```text + systemctl enable mysqld + systemctl start mysqld + systemctl status mysqld + ``` + + 配置密码 + + ```mysql + mysql -uroot -p + > password 回车 + ALTER USER 'root'@'localhost' IDENTIFIED BY '密码'; + ``` + +3. ## **安装ZABBIX服务** + + + + ```text + dnf config-manager --add-repo https://repo.oepkgs.net/openeuler/rpm/openEuler-22.03-LTS/contrib/others/aarch64/ + dnf clean all && dnf makecache + dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-agent --nogpgcheck + ``` + +4. ## **配置和启动zabbix进程** + +​ 配置zabbix + +```mysql +mysql -uroot -p +> password +create database zabbix character set utf8mb4 collate utf8mb4_bin; +create user zabbix@localhost identified by '密码'; +grant all privileges on zabbix.* to zabbix@localhost; +set global log_bin_trust_function_creators = 1; +quit; +``` + +​ 初始化架构和数据 + +```text +zcat /usr/share/doc/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 +mysql -uroot -p +> password +set global log_bin_trust_function_creators = 0; +quit; +``` + +修改zabbix server配置数据库和PHP + +```text +vi /etc/zabbix/zabbix_server.conf +--- +DBPassword=密码 +--- +vi /etc/nginx/conf.d/zabbix.conf +--- +listen 8080;#取消注释 +server_name example.com;#取消注释 +--- +``` + +升级net-snmp + +```text +dnf install net-snmp net-snmp-devel net-snmp-utils --nogpgcheck +``` + +启动zabbix进程 + +```text +systemctl restart zabbix-server zabbix-agent nginx php-fpm +systemctl enable zabbix-server zabbix-agent nginx php-fpm +``` + +访问zabbix首页 + +默认端口是8080 + +![1722339817383](C:\Users\Administrator\Documents\WeChat Files\wxid_3dvp7annei6j22\FileStorage\Temp\1722339817383.png) \ No newline at end of file -- Gitee