zabbix -rockylinux安装

news2024/10/9 22:23:03

文章目录

  • 一、环境配置
    • 1.1、修改主机名
    • 1.2、修改静态ip地址
    • 1.3、系统更新
    • 1.4、安装epel仓库
  • 二、安装zabbix
    • 2.1、添加zabbix仓库
    • 2.2、配置数据库
    • 2.3、配置zabbix服务器
    • 2.4、启动zabbix服务


一、环境配置

1.1、修改主机名

[root@ecs-204824 /]# vi /etc/hostname
[root@ecs-204824 /]# cat /etc/hostname
zabbix
[root@ecs-204824 /]# reboot

1.2、修改静态ip地址

# 进入到网络接口配置文件
[root@zabbix ~]# vi /etc/NetworkManager/system-connections/ens33.nmconnection
# 修改以下内容
[connection]
id=ens33
uuid=9142aa95-a27d-34fc-96f0-b8c9d1611288
type=ethernet
autoconnect-priority=-999
interface-name=ens33
timestamp=1726545704

[ethernet]

[ipv4]
method=manual					# 这里修改为manual
addresses=192.168.1.100			# 本机IP地址
netmask=255.255.255.0			# 子网掩码
gateway=192.168.1.1				# 网关地址

[ipv6]
addr-gen-mode=eui64
method=auto

[proxy]
# 重新加载ens33.nmconnection文件
[root@zabbix ~]# systemctl reload NetworkManager
# 重启网络接口
[root@zabbix ~]# systemctl restart NetworkManager
# 重启系统
[root@zabbix ~]# reboot

1.3、系统更新

[root@zabbix ~]# dnf update -y
Rocky Linux 9 - Extras                           44 kB/s | 2.9 kB     00:00
Dependencies resolved.
================================================================================
 Package                   Arch   Version                       Repo       Size
================================================================================

1.4、安装epel仓库

[root@zabbix ~]# dnf install epel-release -y
Last metadata expiration check: 0:22:44 ago on Tue 08 Oct 2024 08:48:47 AM CST.
Package epel-release-9-8.el9.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!

二、安装zabbix

2.1、添加zabbix仓库

[root@zabbix ~]# rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/9/x86_64/zabbix-release-6.0-4.el9.noarch.rpm
Retrieving https://repo.zabbix.com/zabbix/6.0/rhel/9/x86_64/zabbix-release-6.0-4.el9.noarch.rpm
warning: /var/tmp/rpm-tmp.6UZdaU: Header V4 RSA/SHA512 Signature, key ID 08efa7dd: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:zabbix-release-6.0-4.el9         ################################# [100%]
[root@zabbix ~]# dnf clean all
39 files removed
# 这条命令是跳过一些无法安装的依赖进行下一步安装
[root@zabbix ~]# sudo dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-agent -y --allowerasing --skip-broken
Last metadata expiration check: 0:03:48 ago on Tue 08 Oct 2024 09:15:10 AM CST.
Dependencies resolved.

 Problem: package zabbix-web-deps-6.0.34-release2.el9.noarch from zabbix requires zabbix-web = 6.0.34-release2.el9, but none of the providers can be installed
  - cannot install both zabbix-web-6.0.34-release2.el9.noarch from zabbix and zabbix-web-1:6.0.33-2.el9.noarch from epel
  - package zabbix-apache-conf-6.0.34-release2.el9.noarch from zabbix requires zabbix-web-deps = 6.0.34-release2.el9, but none of the providers can be installed
  - package zabbix-web-mysql-1:6.0.33-2.el9.noarch from epel requires zabbix-web = 1:6.0.33-2.el9, but none of the providers can be installed
  - cannot install the best candidate for the job
[root@zabbix ~]# dnf install zabbix-web-deps -y --allowerasing
Last metadata expiration check: 0:16:28 ago on Tue 08 Oct 2024 09:15:10 AM CST.
Dependencies resolved.

2.2、配置数据库

[root@zabbix ~]# dnf install mariadb-server -y
Last metadata expiration check: 0:18:31 ago on Tue 08 Oct 2024 09:15:10 AM CST.
Dependencies resolved.
[root@zabbix ~]# systemctl enable --now mariadb
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.
[root@zabbix ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

You already have your root account protected, so you can safely answer 'n'.

Switch to unix_socket authentication [Y/n] y
Enabled successfully!
Reloading privilege tables..
 ... Success!


You already have your root account protected, so you can safely answer 'n'.

Change the root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@zabbix ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.5.22-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

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

MariaDB [(none)]> 
MariaDB [(none)]> create database zabbix character set utf8mb4 collate utf8mb4_bin;
Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> create user zabbix@localhost identified by 'yuan3128..';
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.000 sec)
[root@zabbix ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

2.3、配置zabbix服务器

[root@zabbix /]# vi etc/zabbix_server.conf
[root@zabbix /]# cat etc/zabbix_server.conf
# This is a configuration file for Zabbix server daemon
# To get more information about Zabbix, visit http://www.zabbix.com

############ GENERAL PARAMETERS #################

### Option: ListenPort
#       Listen port for trapper.
#
# Mandatory: no
# Range: 1024-32767
# Default:
# ListenPort=10051

### Option: SourceIP
#       Source IP address for outgoing connections.
#
# Mandatory: no
# Default:
# SourceIP=

### Option: LogType
#       Specifies where log messages are written to:
#               system  - syslog
#               file    - file specified with LogFile parameter
#               console - standard output
#
# Mandatory: no
# Default:
# LogType=file

### Option: LogFile
#       Log file name for LogType 'file' parameter.
#
# Mandatory: yes, if LogType is set to file, otherwise no
# Default:
# LogFile=

LogFile=/var/log/zabbixsrv/zabbix_server.log

### Option: LogFileSize
#       Maximum size of log file in MB.
#       0 - disable automatic log rotation.
#
# Mandatory: no
# Range: 0-1024
# Default:
# LogFileSize=1
LogFileSize=0

### Option: DebugLevel
#       Specifies debug level:
#       0 - basic information about starting and stopping of Zabbix processes
#       1 - critical information
#       2 - error information
#       3 - warnings
#       4 - for debugging (produces lots of information)
#       5 - extended debugging (produces even more information)
#
# Mandatory: no
# Range: 0-5
# Default:
# DebugLevel=3

### Option: PidFile
#       Name of PID file.
#
# Mandatory: no
# Default:
# PidFile=/tmp/zabbix_server.pid
PidFile=/run/zabbixsrv/zabbix_server.pid

### Option: SocketDir
#       IPC socket directory.
#               Directory to store IPC sockets used by internal Zabbix services.
#
# Mandatory: no
# Default:
# SocketDir=/tmp

### Option: DBHost
#       Database host name.
#       If set to localhost, socket is used for MySQL.
#       If set to empty string, socket is used for PostgreSQL.
#       If set to empty string, the Net Service Name connection method is used to connect to Oracle database; also see
#       the TNS_ADMIN environment variable to specify the directory where the tnsnames.ora file is located.
#
# Mandatory: no
# Default:
# DBHost=localhost

### Option: DBName
#       Database name.
#       If the Net Service Name connection method is used to connect to Oracle database, specify the service name from
#       the tnsnames.ora file or set to empty string; also see the TWO_TASK environment variable if DBName is set to
#       empty string.
#
# Mandatory: yes
# Default:
# DBName=

DBName=zabbix

### Option: DBSchema
#       Schema name. Used for PostgreSQL.
#
# Mandatory: no
# Default:
# DBSchema=

### Option: DBUser
#       Database user.
#
# Mandatory: no
# Default:
# DBUser=

DBUser=zabbix

### Option: DBPassword
#       Database password.
#       Comment this line if no password is used.
#
# Mandatory: no
# Default:
# DBPassword=
DBPassword=yuan3128..

2.4、启动zabbix服务

[root@zabbix /]# systemctl restart zabbix-server zabbix-agent httpd php-fpm
[root@zabbix /]# systemctl enable zabbix-server zabbix-agent httpd php-fpm

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2200195.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

使用数据库:

数据库: 1.为何需要数据库? 存储数据方法 第一种:用大脑记住数据, 第二种:写纸上, 第三种:写在计算机的内存中, 第四种:写出磁盘文件 2.数据库能做什么&#xff1…

【探索艺术新纪元:Midjourney中文版,让创意无界!】

🎨 艺术,从此触手可及 在这个数字时代,Midjourney中文版正引领一场艺术创作的革命。作为一款前沿的AI绘画工具,它利用深度学习技术,将你的想象转化为触手可及的艺术作品。无需深厚的绘画功底,只需简单的文…

机器学习:opencv--图像拼接

目录 前言 一、两个函数 1.显示图像 2.计算图片特征与描述符 二、代码实例 1.准备图像 2.特征检测 3.特征匹配 4.图像变换 5.图像融合 前言 图像拼接是一种将多张图像合成一幅大图的技术,常用于全景图生成、图像拼接和图像合成等应用场景。 一、两个函数…

第二十三天|回溯算法| 39. 组合总和,40. 组合总和II,131. 分割回文串

目录 39. 组合总和 未剪枝 剪枝优化 40. 组合总和II 131. 分割回文串 回溯 回溯动态规划优化回文串判断 今天的题目自己都没啥思路,二刷的时候再理解一下。尤其是131. 39. 组合总和 本题和77.组合 ,216.组合总和III的区别是:本题没有…

IDEA 输入英文字体变了的问题

**问题:**有时不知道按了什么快捷键导致在 IDEA 输入英文字体变了,如下所示,看起来特别不顺眼: 出现以上问题是因为在输入时切换了中文输入法,并且在提示文字时按了 Shift 空格 键,导致出现以上字体变化情…

H、Happy Number(2024牛客国庆集训派对day7)

题目链接: H-Happy Number_2024牛客国庆集训派对day7 (nowcoder.com) 题目描述: 翻译为中文: 数据范围: 输入样例: 680 输出样例: 326623 分析: 本来以为是dfs,但是看到数据范围1e9, 联想到是…

uniapp自定义导航,全端兼容

我们在用uniapp 开发应用的时候,有的页面需要自定义导航, 1.如果普通的直接使用uni 扩展柜组件的 uni-nav-bar 也基本够用, 2.如果稍微带点自定义的这个值无法支持的,特别在小程序端,胶囊是会压住右边的按钮的 自定…

多模态简单了解

多模态 1.文本编码2. ViT图像编码器2.1图像矩阵self-attention计算: 3.Transformer多模态3.1CLIP 图文交互3.2 对比学习训练3.3 flamingo 图文交互3.4 LLava 图文交互 1.文本编码 简介: 即通过embedding将字符向量化,进入模型即可。 2. ViT…

水下图像增强(论文复现)

本文所涉及所有资源均在 传知代码平台 可获取。 目录 概述 一、论文思路 二、模型介绍: 三、实现方法 四、复现过程(重要) 部署方式 概述 2021年11月,提出一种用于水下图像增强的U型Transformer模型,这是首次在水下图像增强任务中使用Transfo…

InnoDB 磁盘结构 - RedoLog

文章目录 RedoLog是什么刷盘机制崩溃恢复相关参数Redo Log 和 Undo Log 对比 https://dev.mysql.com/doc/refman/8.0/en/innodb-redo-log.html RedoLog是什么 RedoLog 是MySQL的一种日志文件,用于在崩溃恢复期间纠正由不完整事务写入的数据。在正常操作过程中&…

AtCoder Beginner Contest 374

C - Separated Lunch 题目&#xff1a; 思路&#xff1a; dfs枚举每个数是否选入a数组中&#xff0c;求和比较 代码&#xff1a; #include <bits/stdc.h>using namespace std;typedef long long LL;const int N25;int a[N]; bool st[N]; int mn0x3f3f3f3f; int sum; …

VMWare安装ubuntu22虚拟机

1.下载VMware虚拟机和ubuntu 下载地址&#xff1a; VMware Workstation Pro - Download (softonic.com) Download Ubuntu Desktop | Ubuntu 2.Ubuntu的安装 1.VMware创建虚拟机。 2.选择默认即可点击下一步。 3.找到刚才下载的ubuntu20.04。选择下面的稍后安装操作系统。 …

众智OA办公系统 Account/Login SQL注入漏洞复现

0x01 产品简介 众智OA办公系统是一种专门为企业和机构的日常办公工作提供服务的综合性软件平台。它凭借先进的技术和人性化的设计理念,实现了信息的快速传递和自动化处理,帮助企业和机构实现信息化、自动化、智能化和标准化的办公管理。 0x02 漏洞概述 众智OA办公系统 Acc…

【命令操作】linux上watch命令详解 _ 统信 _ 麒麟 _ 方德

原文链接&#xff1a;【命令操作】linux上basename和dirname使用详解 | 统信 | 麒麟 | 方德 Hello&#xff0c;大家好啊&#xff01;今天给大家带来一篇关于Linux上watch命令的详解文章。watch命令是Linux系统中非常有用的一个工具&#xff0c;它可以定期执行指定的命令并在终端…

解决vscode cpptools-srv.exe占用内存过大,导致系统卡死问题

cpptools-srv.exe是安装了c扩展出来的进程。最新版本c扩展cpptools-srv.exe疯狂的占用内存&#xff0c;笔者机器64G内存 都被占满了&#xff0c;&#xff0c;&#xff0c;&#xff0c;&#xff0c;&#xff0c; 网上也试了一些其他的办法&#xff0c;设置里面限制内存不过不好…

一入递归深似海,算法之美无止境

最近在刷leetcode hot100,在写二叉树中最大路径和的时候,看到了一个佬对递归的理解,深受启发,感觉自己对于递归的题又行了!!! 这里给大家分享一下(建立大家先去尝试一下这道题再来看 124. 二叉树中的最大路径和 二叉树中的 路径 被定义为一条节点序列&#xff0c;序列中每…

【优选算法】--- 位运算

位运算 一、常见的位运算总结&#xff08;重点&#xff01;&#xff09;1、关于位运算的符号2、&#xff08;判断&#xff09;给一个数字n&#xff0c;确定它的二进制表示中的第X位&#xff0c;是1还是0&#xff1f;3、&#xff08;修改&#xff09;如何把一个二进制的数字的第…

算法:双指针系列(一)

双指针系列 一、移动零&#xff08;一&#xff09;题目分析&#xff08;二&#xff09;代码展示二、复写零&#xff08;一&#xff09;题目分析&#xff08;二&#xff09;代码展示三、快乐数&#xff08;一&#xff09;题目分析&#xff08;二&#xff09;代码展示&#xff08…

OceanBase 4.x 部署实践:如何从单机扩展至分布式部署

OceanBase 4.x 版本支持2种部署模式&#xff1a;单机部署与分布式部署&#xff0c;同时支持从单机平滑扩展至分布式架构。这样&#xff0c;可以有效解决小型业务向大型业务转型时面临的扩展难题&#xff0c;降低了机器资源的成本。 以下将详述如何通过命令行&#xff0c;实现集…

Matlab数据预处理——最小二乘法消除多项式趋势项

关注公众号“电击小子程高兴的MATLAB小屋”获取专属优惠 概要&#xff1a; 最小二乘法是一种常用的统计方法&#xff0c;用于通过拟合数据来消除多项式趋势项。以下是关于如何使用最小二乘法消除多项式趋势项的步骤和概念&#xff1a; 概念&#xff1a; 多项式趋势项&#…