栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

CentOS8下Zabbix6.0的安装使用

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

CentOS8下Zabbix6.0的安装使用

目录
  • 一、安装
    • 1.安装 Zabbix repository
    • 2.安装Zabbix server,Web前端,agent
    • 3.创建初始数据库
    • 4.配置数据库
    • 5.配置前端 PHP
    • 6.启动 Zabbix server 和 agent 并设置开机自启
    • 7.配置数据库连接
  • 二、使用
    • 1.登录
    • 2.切换至中文


一、安装 1.安装 Zabbix repository
rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-1.el8.noarch.rpm
dnf clean all
2.安装Zabbix server,Web前端,agent
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent

安装过程如果报错:

[root@localhost ~]# dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
Last metadata expiration check: 0:39:26 ago on Tue 31 May 2022 05:39:10 PM CST.
Error: 
 Problem 1: cannot install the best candidate for the job
  - nothing provides libOpenIPMI.so.0()(64bit) needed by zabbix-server-mysql-6.0.5-1.el8.x86_64
  - nothing provides libOpenIPMIposix.so.0()(64bit) needed by zabbix-server-mysql-6.0.5-1.el8.x86_64
  - nothing provides libnetsnmp.so.35()(64bit) needed by zabbix-server-mysql-6.0.5-1.el8.x86_64
  - nothing provides libodbc.so.2()(64bit) needed by zabbix-server-mysql-6.0.5-1.el8.x86_64
  - nothing provides libmariadb.so.3()(64bit) needed by zabbix-server-mysql-6.0.5-1.el8.x86_64
  - nothing provides libmariadb.so.3(libmariadb_3)(64bit) needed by zabbix-server-mysql-6.0.5-1.el8.x86_64
  - nothing provides libmariadb.so.3(libmysqlclient_18)(64bit) needed by zabbix-server-mysql-6.0.5-1.el8.x86_64
 Problem 2: cannot install the best candidate for the job
  - nothing provides php-mysqlnd needed by zabbix-web-mysql-6.0.5-1.el8.noarch
 Problem 3: cannot install the best candidate for the job
  - nothing provides nginx needed by zabbix-nginx-conf-6.0.5-1.el8.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

执行命令:

dnf install OpenIPMI
3.创建初始数据库

MySQL8.0 数据库中执行以下语句:

create database zabbix character set utf8mb4 collate utf8mb4_bin;
create user zabbix@localhost identified by 'zabbix';
grant all privileges on zabbix.* to zabbix@localhost;

执行以下命令,会提示输入密码:

zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix
4.配置数据库
vi /etc/zabbix/zabbix_server.conf

配置以下内容:

DBPassword=zabbix
5.配置前端 PHP
vi /etc/nginx/conf.d/zabbix.conf
listen          80;
server_name     localhost;

注意:在 /usr/local/nginx/conf/nginx.conf 文件中打开如下语句:

include /etc/nginx/conf.d/*.conf;
6.启动 Zabbix server 和 agent 并设置开机自启
systemctl restart zabbix-server zabbix-agent nginx php-fpm
systemctl enable zabbix-server zabbix-agent nginx php-fpm
7.配置数据库连接

浏览器输入 http://192.168.1.38 访问Zabbix:

点击下一步,在配置数据库连接时报错 The server requested authentication method unknown to the client:

解决方法:
mysql 8.0 之后,caching_sha2_password 是默认的身份验证插件,而不是之前的mysql_native_password。因此修改 mysql 的默认身份验证插件即可:

ALTER USER zabbix@‘%’IDENTIFIED WITH mysql_native_password BY 'zabbix';
flush privileges;

点击下一步,设置服务名、时区等:

点击下一步,安装成功:

二、使用 1.登录

浏览器输入 http://192.168.1.38 进入登录页面,默认用户/密码为 Admin/zabbix:

登录后进入首页:

2.切换至中文

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/939443.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号