一起学zabbix 01.zabbix4.2 安装

zabbix 安装

https://www.zabbix.com/download

环境

192.168.48.55 zabbix

准备

zabbix源

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

epel源

cat > /etc/yum.repos.d/epel.repo << EOF
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
EOF

安装

安装zabbix

yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get

创建mysql数据库

wget -c https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
rpm -ivh mysql80-community-release-el7-1.noarch.rpm
yum -y install yum-utils
yum-config-manager --disable mysql80-community
yum-config-manager --enable mysql57-community
yum install mysql-community-server -y
# 启动mysql
systemctl start mysqld
# 开机启动
systemctl enable mysqld
# 查看root临时密码
grep 'temporary password' /var/log/mysqld.log
# 使用mysql临时登录,修改root密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456@Abc';
# 创建zabbix用户和库
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by "Zabbix@123";
# 退出mysql,后导入zabbix数据
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p'Zabbix@123' zabbix

zabbix服务端配置

# 修改/etc/zabbix/zabbix_server.conf文件,修改mysql连接密码
DBPassword=Zabbix@123
# 添加上海区
sed -i.ori '19a php_value date.timezone  Asia/Shanghai' /etc/httpd/conf.d/zabbix.conf
# 解决图形列表下中文乱码
yum -y install wqy-microhei-fonts
mv /usr/share/fonts/dejavu/DejaVuSans.ttf /usr/share/fonts/dejavu/DejaVuSans.ttf.bak
cp -f /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf

zabbix 启动

systemctl start zabbix-server httpd
# 开机启动
systemctl enable zabbix-server httpd

访问

http://192.168.48.55/zabbix

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

语言改为中文

在这里插入图片描述

开启zabbix agent

在这里插入图片描述

yum -y install zabbix-agent

配置文件/etc/zabbix/zabbix_agentd.conf
# 主要配置如下,默认即可
Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix server
# 启动zabbix客户端
systemctl start zabbix-agent
# 开机启动
systemctl enable zabbix-agent

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值