首页 > 系统相关 >centos-9stream安装zabbix-all

centos-9stream安装zabbix-all

时间:2023-07-02 17:03:19浏览次数:42  
标签:... 9stream centos server zabbix MariaDB root gby

centos-9stream安装zabbix-all

下载Zabbix

1.zabbix是一个基于web界面的提供分布式系统监控以及网络监控功能的企业级开源解决方案。zabbix能监控各种网络参数,保证服务器系统的安全运行,并且能够提供灵活的通知报警机制让系统管理员能快速的发现问题,定位问题,解决问题.

2.zabbix除了支持主动模式之外还支持被动模式。所谓的主动还是被动针对的是agent,agent向zabbix的server发送数据,就表示是主动模式,agent被动的等待server来提取数据,就是被动模式。

3.zabbix支持分布式的架构,可以采用zabbix proxy的方式来实现监控平台的轻松扩容,可以简单的实现多数据中心多云平台监控。你想要扩容,搭建zabbix proxy即可。

4.zabbix支持多种报警,短信(SMS),邮件,语音,微软的team,企业微信,钉钉....

5.zabbix有非常漂亮的web界面(相对的),但是又不仅仅只是显示监控的数据,还可以通过web对监控内容进行调整和配置,还支持多用户访问,以及外部身份认证与的集成。

6.zabbix是免费的。是开源的,是对公众可以任意使用的。虽然zabbix是开源的免费的,但是如果运维人员的水平不够可能也没办法发挥zabbix的全部功能,一般对于开源监控平台来说,如果想玩到高级的程度,必须要具备开发的知识。这个知识针对中小型的公司,需要运维人员对监控平台进行维护和问题发现以及问题处理,对开发人员要求动态实时的定制需要监控的内容。所以说商机就来了,有很多公司提供zabbix的技术支持,zabbix社区就是这些众多提供商业支持的最大的一家公司。

1.zabbix allinone安装

登录zabbix官网,选择好你想安装的相应版本

centos-9stream安装zabbix-all_mysql

centos-9stream安装zabbix-all_nginx_02

a.安装zabbix 安装yum源

#如果您安装了 EPEL包,请将其禁用。编辑文件 /etc/yum.repos.d/epel.repo 并添加以下语句。
[epel]
...
excludepkgs=zabbix*
#如果你没有安装继续安装 zabbix 存储库。
[root@gby ~]# rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/9/x86_64/zabbix-release-6.4-1.el9.noarch.rpm
Retrieving https://repo.zabbix.com/zabbix/6.4/rhel/9/x86_64/zabbix-release-6.4-1.el9.noarch.rpm
warning: /var/tmp/rpm-tmp.ak25Hy: Header V4 RSA/SHA512 Signature, key ID 08efa7dd: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:zabbix-release-6.4-1.el9         ################################# [100%]
[root@gby ~]# yum clean all
21 files removed

b.安装Zabbix server,Web前端,agent

[root@gby ~]# dnf -y install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent

c.创建初始化数据库

#确保您已启动并运行数据库服务器。潜藏意思急速mysql你得自己装
https://www.zabbix.com/documentation/current/en/manual/installation/requirements
#要求数据库版本10.5.00-10.11.X
[root@gby ~]# wget https://dlm.mariadb.com/2869873/MariaDB/mariadb-10.11.2/yum/rhel/mariadb-10.11.2-rhel-9-x86_64-rpms.tar
[root@gby ~]# tar xvf mariadb-10.11.2-rhel-9-x86_64-rpms.tar

[root@gby ~]# yum -y install mariadb-server
[root@gby ~]# systemctl enable mariadb --now
[root@gby ~]# 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] n
 ... skipping.

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

Change the root password? [Y/n] Y
New password: #Admin123!@#
Re-enter new password: #Admin123!@#
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] 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
 - 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@gby ~]# mysql -uroot -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.5.16-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)]> create database zabbix character set utf8mb4 collate utf8mb4_bin;
Query OK, 1 row affected (0.003 sec)

MariaDB [(none)]> create user zabbix@localhost identified by 'Admin123!@#';
Query OK, 0 rows affected (0.017 sec)

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

MariaDB [(none)]> set global log_bin_trust_function_creators = 1;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> quit;
Bye
#在 Zabbix 服务器主机上导入初始模式和数据。系统将提示您输入新创建的密码。
[root@gby ~]# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
Enter password: #Admin123!@#
#导入数据库架构后禁用 log_bin_trust_function_creators 选项。
[root@gby ~]# mysql -uroot -p
Enter password: #Admin123!@#
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 10.5.16-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)]> set global log_bin_trust_function_creators = 0;
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> quit;
Bye

d. 为 Zabbix 服务器配置数据库

#编辑文件/etc/zabbix/zabbix_server.conf
[root@gby ~]# sed -i 's/# DBPassword=/DBPassword=Admin123!@#/' /etc/zabbix/zabbix_server.conf

e. 为 Zabbix 前端配置 PHP

#编辑文件 /etc/nginx/conf.d/zabbix.conf 取消注释并设置“listen”和“server_name”指令。
[root@gby ~]# sed -i 's/#        listen          8080;/        listen          8080;/' /etc/nginx/conf.d/zabbix.conf 
[root@gby ~]# sed -i 's/#        server_name     example.com;/        server_name     example.com;/' /etc/nginx/conf.d/zabbix.conf

f.启动zabbix server和agent

#启动 Zabbix 服务器和代理进程,并使其在系统启动时启动。
[root@gby ~]# systemctl restart zabbix-server zabbix-agent nginx php-fpm
[root@gby ~]# systemctl enable zabbix-server zabbix-agent nginx php-fpm
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-server.service → /usr/lib/systemd/system/zabbix-server.service.
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-agent.service → /usr/lib/systemd/system/zabbix-agent.service.
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service → /usr/lib/systemd/system/nginx.service.
Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service → /usr/lib/systemd/system/php-fpm.service.

2.zabbix的web部署

http://192.168.1.17:8080/setup.php

账户Admin密码zabbix

centos-9stream安装zabbix-all_nginx_03

如果没有中文包的话

由于没有中文包,所以我们需要安装一下中文包
[root@zabbix-allinone ~]# yum -y install langpacks-zh_CN
[root@zabbix-allinone ~]# yum -y install glibc-common
如果你已经安装过glibc-common,你重新安装即可
[root@zabbix-allinone ~]# yum -y reinstall glibc-common

centos-9stream安装zabbix-all_nginx_04

centos-9stream安装zabbix-all_php_05

centos-9stream安装zabbix-all_nginx_06

centos-9stream安装zabbix-all_mysql_07

centos-9stream安装zabbix-all_mysql_08

结束之有话想说

既然看完了那就赶紧去试试吧骚年。

标签:...,9stream,centos,server,zabbix,MariaDB,root,gby
From: https://blog.51cto.com/u_15606628/6605806

相关文章

  • CentOS 9 x64 使用 Nginx、Supervisor 部署 Go/Golang 服务
    前言在CentOS9x64系统上,可以通过以下步骤来部署Golang服务。1.安装必要的软件包安装以下软件包:Golang:Golang编程语言Nginx:Web服务器Supervisor:进程管理工具Git:版本控制工具EPEL:扩展软件包可以通过以下命令来安装:yum-yupdateyuminstallnginxgolangepel-......
  • CentOS 9 x64 使用 Nginx、Supervisor 部署 Go/Golang 服务
    前言在CentOS9x64系统上,可以通过以下步骤来部署Golang服务。1.安装必要的软件包安装以下软件包:Golang:Golang编程语言Nginx:Web服务器Supervisor:进程管理工具Git:版本控制工具EPEL:扩展软件包可以通过以下命令来安装:yum-yupdateyuminstallnginxgolangepel......
  • postgres安装记录-centos
    镜像方式安装:1.下载依赖以及脚本[email protected]:a356a/deploy.git2.执行脚本-postgresImage.sh脚本具体执行:关闭防火墙systemctlstopfirewalldsystemctldisablefirewalld拉取镜像并启动镜像dockerpullpostgres:12-alpine3.16dockerrun--namepostgresDocker12......
  • CentOS Linux的最佳替代方案(三)_银河麒麟Kylin Linux Advanced Server V10 SP2 for X86
    CentOSLinux的最佳替代方案(三)_银河麒麟KylinLinuxAdvancedServerV10SP2forX86安装教程1银河麒麟KylinLinuxAdvancedServerV10简介银河麒麟高级服务器操作系统V10是针对企业级关键业务,适应虚拟化、云计算、大数据、工业互联网时代对主机系统可靠性、安全性、性能、扩......
  • CentOS安装k8s
    1.系统配置硬件配置基本要求资源大小硬盘>=20Gcpu>=2核内存>=2G本教程配置主机名IP配置master192.168.10.1553核+2G+20Gworker1192.168.10.2343核+2G+20Gworker2192.168.10.1473核+2G+20G2.安装必要软件所有机器都要......
  • centos8.2升级centos stream
    背景2020年12月08日,CentOS官方宣布CentOSLinux项目将停止并推出CentosStream项目。2022后CentOS8的使用者将无法获得包括问题修复和功能更新在内的任何软件维护和支持。升级过程首先,输入如下命令,查看你的yum仓库是否有centos-release-stream[root@gby~]#yumsea......
  • CentOS 7 修改主机名
    缘由主机名与ip域名等映射息息相关,并且也更能体现这一台服务器的作用。对于管理多台服务器来说,主机名就显得比较重要。修改主机名在一台全新的CentOS服务器中,默认的主机名是localhost.localdomain。前面的localhost是主机名,后面的localdomain表示domain(这个不知道是啥的话,百度一下......
  • docker安装记录-centos
    1.下载依赖以及脚本[email protected]:a356a/deploy.git2.执行脚本-dockerInstall.sh脚本具体执行:卸载原有dockeryum-yremove$(yumlistinstalled|grepdocker|awk'{print$1}')安装需要的依赖yuminstall-yyum-utilsdevice-mapper-persistent-datalvm2添加镜像......
  • centos7系统分区方案
    景:windows桌面运维为主的我,前几天接到一个去某客户上架安装服务器的工作任务,含糊的说要上架几台服务器顺便安装Centos系统,于是我便下载了一个Centos7.2版本的镜像,顺利的用USBwriter写入到u盘。带着这个U盘就出发。 虽然有安装经验,但是由于接触不是很多,在熟练度上真不能和大神或在l......
  • CentOS7下swap分区创建(添加),删除以及相关配置
     小叨下背景:笔者的服务器内存只有1g,少得可怜。之前使用apache,不堪忍受其过量的内存消耗,网站卡得想哭,数据库也不断地崩,无奈投入nginx的怀抱并且已经喜欢上了nginx,具体请看上文《CentOS7部署轻量级web服务器nginx+php》。     然而过了几个月后数据库还是继续崩,经查询mysql......