Zabbix 6.0 安装

一,Zabbix大纲 

一,zabbix6.4安装

配置:

技术

版本
CentOS8.0
Zabbix6.0

一,zabbix部署安装流程:

1,环境配置

1.1,关闭防火墙

systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i "s/enforcing/permissive/g" /etc/selinux/config

1.2,换源

cd /etc/yum.repos.d
rm -rf *
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all
yum makecache

1.3,安装依赖包

yum install scl-utils-* apr-* rsync lsof perl-DBD-MySQL socat php-bcmath php-xml php-ldap php-json php-gd php-mysqlnd php-mbstring php-fpm php-bcmath OpenIPMI httpd net-snmp-* boost-program-options-* createrepo unzip  -y

1.4,安装Zabbix存储库

rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-1.el8.noarch.rpm
#去zabbix官网复制rpm包
dnf clean all

下载Zabbixicon-default.png?t=N7T8https://www.zabbix.com/cn/download

目录地址
zabbix.6.4rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/8/x86_64/zabbix-release-6.4-1.el8.noarch.rpm
zabbix.6.0rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-4.el8.noarch.rpm

1.5,安装Zabbix server与Web前端

dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy

2,配置数据库

2.1,引入mariadb源

cat <<EOF > /etc/yum.repos.d/mariadb.repo
# MariaDB 10.6 CentOS repository list - created 2022-01-16 15:10 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = https://mirrors.cloud.tencent.com/mariadb/yum/10.6/centos8-amd64
module_hotfixes=1
gpgkey=https://mirrors.cloud.tencent.com/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

2.2,安装数据库

dnf -y install mariadb-server

2.3,启动数据库并设置开机自启

systemctl start mariadb && systemctl enable mariadb

2.4,初始化数据库

mariadb-secure-installation

2.5,授权数据库

mysql -uroot -p    #此处我直接回车未定义密码
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'password';    #此处我定义密码为password
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;

2.6,导入初始架构和数据

# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
#输入密码:password

或者手动导入表结构

mysql -uzabbix -pzabbix@findsec123 zabbix < /home/zabbix-6.4.8/database/mysql/schema.sql
mysql -uzabbix -pzabbix@findsec123 zabbix < /home/zabbix-6.4.8/database/mysql/images.sql
mysql -uzabbix -pzabbix@findsec123 zabbix < /home/zabbix-6.4.8/database/mysql/data.sql
#密码自定义

此时执行下述命令查看数据库,可见架构与数据均已导入

mysql -u root -p
> use zabbix;
> show tables;

2.7,为Zabbix server配置数据库

vim /etc/zabbix/zabbix_server.conf
DBHost=localhost  #去掉注释
DBPassword=password #去掉注释并填入password

3,配置php

vim /etc/php.ini

post_max_size = 16M   #由8M改为16M
max_execution_time = 300   #由30改为300
max_input_time = 300   #由60改为300

4,配置nginx

vim /etc/nginx/conf.d/zabbix.conf

listen 80;  #去掉注释
server_name example.com;  #去掉注释

cp -r /usr/share/zabbix/ /usr/share/nginx/html/   #复制主目录

5,安装中文包

dnf install langpacks-zh_CN.noarch    # 安装zh_CN语言包
dnf -y install glibc-common    # 安装glibc-common实现对语言包的识别
# locale -a | grep zh_CN
zh_CN
zh_CN.gb18030
zh_CN.gbk
zh_CN.utf8

6,启动服务并设置开机自启

systemctl restart zabbix-server nginx php-fpm
systemctl enable zabbix-server nginx php-fpm

7,访问页面

http://192.168.137.132/zabbix

用户:Admin

密码:zabbix

1,依赖关系

2zabbix二进制安装

关闭selinux

vim /etc/selinux/config

SELINUX=disabled

Sestatus

rboot

centos 7 添加阿里云镜像(这是7的镜像,如果安装8请改成“centos-8.repo”)

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

yum install epel-release

 

或者:

# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm

# yum clean all

(zabbix官方镜像5.0)

 

安装常用的开发组件

yum groups install "Development Tool"

yum groups info "Development Tools"

 

增加zabbix镜像源

zabbix4.0 :     rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

zabbix5.0 :     rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm

Zabbix6.0 

rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/7/x86_64/zabbix-release-6.4-1.el7.noarch.rpm

 

 

yum install iptables-services

 

安装zabbix server和fronted

yum install zabbix-server-mysql

yum install zabbix-web-mysql

 

数据库安装

yum install mariadb-server

systemctl start mariadb.service

systemctl status mariadb.service

mysql_secure_installation

 

Passwd:zhao

创建数据库

mysql -uroot -p

create database zabbix character set utf8 collate utf8_bin;

grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix@findsec123';

 

导入数据结构

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pzabbix@findsec123 zabbix

 

修改zabbix server配置

vim /etc/zabbix/zabbix_server.conf

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix@findsec123

 

 

 

启动服务

systemctl start zabbix-server.service

systemctl enable zabbix-server.service

systemctl status zabbix-server.service

tailf /tmp/zabbix_server.log

 

配置Zabbix frontend

vim /etc/php.ini

max_execution_time = 300

memory_limit = 128M

post_max_size = 16M

upload_max_filesize = 2M

max_input_time = 300

max_input_vars = 10000

always_populate_raw_post_data = -1

date.timezone = Asia/Shanghai

 

启动httpd

systemctl start httpd.service

systemctl enable httpd.service

systemctl status httpd.service

 

web登录

http://10.211.55.7/zabbix/setup.php

 

默认账户名

Admin

默认密码

zabbix

 

安装Zabbix Agent

yum install zabbix-agent

systemctl start zabbix-agent.service

来自 <增加server安装命令 · findsec-cn/zabbix@7dc72b1 · GitHubZabbix 4.0企业实战课程资料. Contribute to findsec-cn/zabbix development by creating an account on GitHub.icon-default.png?t=N7T8https://github.com/findsec-cn/zabbix/commit/7dc72b1ded9e951f64951fe9f66ef51184d3d9a8>

虚拟机会自动更改IP地址,注意!

3zabbix容器安装

yum install docker

4,安装一个agent

安装zabbix源

rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

安装zabbix-agent包

yum search zabbix-agent

yum install zabbix-agent

配置agent

vim /etc/zabbix/zabbix_agentd.conf

server=   //server的IP地址

serveractive=     //server的IP地址

hostname=               //server的名称保持一致

打开agent服务

systemctl start zabbix-agent.service

开机自启agent服务

systemctl enable zabbix-agent.service

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Zabbix是一款全功能性的企业级监控软件,支持不同的监控场景,包括网络、服务器、应用、数据库等等。Zabbix 6.0Zabbix软件的最新版本,对性能和功能均有所提升。安装和部署Zabbix 6.0需要遵循以下步骤: 1. 安装必备软件 在安装Zabbix 6.0之前,需要先安装必备的软件如Apache、PHP和MySQL等。可以使用apt-get命令或yum命令之类的包管理工具来安装这些软件。 对于基于Debian或Ubuntu的系统,可以使用以下命令安装: sudo apt-get install apache2 php7.4 php7.4-mysql php7.4-gd php7.4-xml php7.4-bcmath php7.4-mbstring mysql-server mysql-client 对于基于CentOS或RHEL的系统,可以使用以下命令安装: sudo yum install httpd php74 php74-mysqlnd php74-gd php74-xml php74-bcmath php74-mbstring mariadb-server mariadb-client 2. 下载Zabbix 6.0 可以到Zabbix官方网站下载Zabbix 6.0安装包。也可以使用wget或curl命令下载安装包。 wget https://cdn.zabbix.com/zabbix/sources/stable/6.0/zabbix-6.0.0.tar.gz 3. 解压安装包 使用以下命令解压下载的安装包: tar -zxvf zabbix-6.0.0.tar.gz 4. 编译和安装Zabbix 进入解压后的目录,使用以下命令编译和安装Zabbix: cd zabbix-6.0.0 ./configure --enable-server --with-mysql --with-net-snmp --with-libcurl --with-libxml2 make install 5. 创建数据库 使用以下命令创建MySQL数据库和用户: mysql -u root -p create database zabbix character set utf8 collate utf8_bin; create user 'zabbix'@'localhost' identified by 'password'; grant all privileges on zabbix.* to 'zabbix'@'localhost'; 6. 导入数据库 使用以下命令导入Zabbix所需的初始数据: cd database/mysql/ mysql -u zabbix -p zabbix < schema.sql mysql -u zabbix -p zabbix < images.sql mysql -u zabbix -p zabbix < data.sql 7. 配置Zabbix服务器 编辑Zabbix服务器的配置文件/etc/zabbix/zabbix_server.conf,配置数据库连接: DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=password 8. 运行Zabbix服务器 使用以下命令启动Zabbix服务器: service zabbix-server start 9. 配置Zabbix Web界面 编辑Zabbix Web界面的配置文件/etc/zabbix/apache.conf,配置Zabbix服务器的地址和端口: php_value date.timezone Asia/Shanghai php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M Alias /zabbix /usr/share/zabbix/ <Directory "/usr/share/zabbix/"> Options FollowSymLinks AllowOverride None Require all granted </Directory> 10. 启动Apache服务 使用以下命令启动Apache服务: service httpd start 这些就是安装和部署Zabbix 6.0的基本步骤。安装好之后,访问http://服务器IP地址/zabbix,可以登录Zabbix Web界面并开始配置主机和监控项等。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值