本文主要是介绍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_64Problem 2: cannot install the best candidate for the job- nothing provides php-mysqlnd needed by zabbix-web-mysql-6.0.5-1.el8.noarchProblem 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.切换至中文
这篇关于CentOS8下Zabbix6.0的安装使用的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!