首页 > 系统相关 >Ubuntu 22.04.4 Zabbix6.4部署安装

Ubuntu 22.04.4 Zabbix6.4部署安装

时间:2024-03-24 09:01:55浏览次数:32  
标签:... Ubuntu Zabbix Zabbix6.4 zabbix 22.04 mysql server root

 简介

Zabbix 是一款企业级的开源监控解决方案,主要用于分布式系统和网络设备的监控。它提供了基于Web界面的集中管理和监控功能,能够实时监控服务器的各项性能指标,如CPU负载、内存使用情况、磁盘空间占用,以及网络流量等,并且支持自动发现网络中的服务器与设备。

 安装步骤

 一、安装前准备

1.关闭防火墙

#systemctl stop firewalld
#systemctl disable firewalld

2. 关闭selinux

#SELINUX=disabled
这是临时关闭,重启后恢复,我没有永久关闭,Zabbix正常使用

 永久关闭可以参考这篇文章

 二、Zabbix的安装

1.点击跳转Zabbix官网

根据自己的OS和需求选择对应的版本和组件

我是使用Ubuntu22.04安装的,这里你可以根据自己的需求选择就行了

2.开始安装和配置Zabbix

选择好后在该网页的下方会有官方的安装步骤,如下图所示

 A. 安装 Zabbix 存储库
# wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb
# dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb
# apt update
b. 安装Zabbix server,Web前端,agent 
# apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent

官方教程的这两个步骤是没问题的,直接照着操作就行了

 c. 创建初始数据库

这里我是使用的mariadb数据库,下面是具体的安装步骤


# apt install mariadb-server -y
# systemctl start mariadb
# systemctl enable mariadb
# mysql_secure_installation

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

Enter current password for root (enter for none): # 当前root还没有密码,直接回车即可

Set root password? [Y/n] y						# 是否要设置root密码,y
New password: 								# 123(可自定义)
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				# 当前有个anonymous用户,是否移除   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] n			# 不允许root远程登录, n
 ... skipping.

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		# 是否移除test数据库  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			# 是否重载权限表   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!			# 配置完成

然后就可以照着官方教程继续往下了,新建用户,设置密码,授予权限等。

# mysql -uroot -p
这里输入刚刚设置的mariadb数据库的密码
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by '123';  #这里密码123可自定义,下一步需要用到
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;

导入初始架构和数据,系统将提示您输入新创建的密码 ,这里输入上一步自定义的user zabbix@localhost的密码

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

导入数据库模式后禁用 log_bin_trust_function_creators 选项,这里跟着官方教程来就行

# mysql -uroot -p
这里是mariadb数据库密码
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
 d. 为Zabbix server配置数据库

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

vi /etc/zabbix/zabbix_server.conf

 修改

# DBPassword=password

这里要找到这一行,把前面的#号去掉,并修改后面的password为自己设置的数据库密码,具体vim命令可参考Ubuntu虚拟机vim操作命令

 e. 启动Zabbix server和agent进程

启动Zabbix server和agent进程,并为它们设置开机自启:

# systemctl restart zabbix-server zabbix-agent apache2
# systemctl enable zabbix-server zabbix-agent apache2

这里也是直接按照官方教程来就行

F. 打开 Zabbix UI 网页

使用 Apache Web 服务器时 Zabbix UI 的默认 URL 是 http://host/zabbix,host为Ubuntu的ens33的ip地址,可以使用 ip a 命令查看ens33的ip地址信息。

这里可能出现apache2的80端口被占用的问题,可以使用nestat -tnlp |grep 80查看,如果是被占用了,可以使用kill 进程号的命令杀掉对应进程。

注:在配置DB连接时只需输入自己之前创建的mariadb数据库密码即可

安装完成

 至此,Ubuntu 22.04.4 Zabbix6.4部署安装完成。

标签:...,Ubuntu,Zabbix,Zabbix6.4,zabbix,22.04,mysql,server,root
From: https://blog.csdn.net/iksjls/article/details/136976529

相关文章

  • 在idea中连接ubuntu 16中的docker
    在idea中连接ubuntu16中的docker前提ubuntu安装了docker1.安装docker插件,在file->settings中2.进入Build,Execution,Deployment->Docker通过加号添加这个时候其实不会图片中连接成功的标志,因为还没有配置docker服务,注意我虚拟机的ip为192.168.93.1313.配置dock......
  • ubuntu设置时间显示为24小时制
    对ubuntu默认的时间显示格式不太满意,查阅了相关资料进行修改为24小时制度,特此记录和分享给需要设置的网友查看当前的timezoneroot@jumpserver:~#timedatectlLocaltime:Sat2024-03-2312:45:53UTCUniversaltime:Sat2024-03-2312:45:53UT......
  • ubuntu22.4安装QT
    1、QT安装包下载首先需要在qt官网注册一个账号,然后下载一个在线安装器qt-unified-linux-x64-4.7.0-online.run,注意,注册QT账号时建议使用qq邮箱,亲测163邮箱不好使,账号认证邮件无法收到。2、在线安装完后,QTcreator无法启动,报错如下:Ubuntu22.04安装Qt之后启动QtCreator失败,报错......
  • ubuntu安装cuda和cudnn,并测试tensorflow和pytorch库的与cuda的兼容性(2023年版)
    lspci|grep-invidia查看nvidia设备,看到GPUgcc--version检查是否安装上gcc软件包根据官方文档指示,pipinstalltorch==1.13.1+cu117-fhttps://download.pytorch.org/whl/torch_stable.html,pipinstalltorchaudio==0.13.1+cu117-fhttps://download.pytorch.org/whl/torch......
  • Linux/Ubuntu/Debian终端terminal中ls的详细用法-l -lt -ld -lR -lh -F
    使用各种选项列出当前目录中的文件和目录:以长(表格)格式列出:ls-l列出有关特定目录的信息:ls-lddir-name列出所有文件(包括隐藏文件):ls-a附加指示文件类型的符号:ls-F按上次修改时间排序列出文件:ls-lt以人类可读的格式列出文件大小:......
  • Ubuntu2204 GUI root用户无法登录的处理方法
    Ubuntu2204GUIroot用户无法登录的处理方法背景今天上午同事cloneubuntu2204之后想通过GUI登录修改IP以及进行一些安全设置发现root用户登录输入密码后就会返回登录界面.会进入一个无线死循环的额状态.这里记录一下进行地址设置和解决root登录的问题.解决IP地址的设......
  • Ubuntu使用gvm安装go
    建议使用非sudo用户装,方便vscode连接时go插件使用。1.若系统之前存在旧版本的go,无则跳过此步骤sudorm-rf/usr/local/gosudoapt-getremovegolangsudoapt-getremovegolang-gosudoapt-getautoremove2.到gvm的官方github页面找到安装的命令https://github.com/moo......
  • Ubuntu部署Maxkey单点登录认证系统
    1:基础环境ubuntu-23.10-live-server-amd64.isoDockerversion24.0.5,build24.0.5-0ubuntu1MaxKey-v4.0.2-GA2:Git克隆远程仓库到本地gitclonehttps://gitee.com/dromara/MaxKey.git3:安装MaxKey3-1:进入/root/MaxKey/docker目录cd/root/MaxKey/docker3-2:查看/root......
  • ubuntu 搭建Samba服务
    1.sudoapt-getinstallsamba2.sudocp/etc/samba/smb.conf/etc/samba/smb.conf.bak3.sudovi/etc/samba/smb.conf在smb.conf的文件最后加入以下配置并保存,然后退出[work] #ubuntu下的共享目录名称comment=sambahomedirectorypath=/home/book/ #共享目......
  • opengl日记7-ubuntu20.04开发环境opengl拓展glfw和glad环境搭建
    文章目录ubuntu中安装opengl核心环境安装glfw安装glad测试验证程序vscode的task.json配置如下note参考ubuntu中安装opengl核心环境可执行如下命令进行整体安装:sudoapt-getinstalllibgl1-mesa-dev*或者单独安装1、提供编译程序必须软件包的列表信息sudoapt......