Centos7安装Zabbix4.2超详细教程

一、环境配置

  • 安装 mysql 数据库
  • 关闭 防火墙
firewall-cmd --state // 查看防火墙状态
systemctl stop firewalld.service // 临时关闭防火墙
systemctl disable firewalld.service // 开机禁止启动防火墙
  • 关闭 SELINUX
setenforce 0 // 临时关闭selinux
vim /etc/sysconfig/selinux
SELINUXTYPE=disabled // 永久关闭selinux

二、安装 Zabbix4.2

  • 添加 zabbix 软件仓库
rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-2.el7.noarch.rpm
  • 更换 zabbix 源

vim /etc/yum.repos.d/zabbix.repo

[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.2/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591

[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=http://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.2/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=1

[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://mirrors.tuna.tsinghua.edu.cn/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
  • 安装 zabbix server 、agent
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
  • 创建数据库
mysql -u root -p
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> flush privileges;
  • 导入初始数据
rpm -ql zabbix-server-mysql
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
  • zabbix server 配置数据库

vim /etc/zabbix/zabbix_server.conf

DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
  • httpd 配置时区

vim /etc/httpd/conf.d/zabbix.conf

php_value date.timezone Asia/Shanghai
  • 启动 zabbix serve 、agent 和 httpd 进程
systemctl start zabbix-server zabbix-agent httpd
systemctl enable zabbix-server zabbix-agent httpd
  • 检查服务状态
netstat -ntpl
systemctl status zabbix-server zabbix-agent httpd
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值