zabbix原理与搭建

发布时间 2023-03-28 23:32:07作者: 往事已成昨天

zabbix的含义:

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

yum makecache

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

rpm -ivh zabbix-release-4.0-1.el7.noarch.rpm

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

121 ping mirror.tuna.tsinghua.edu.cn

122 echo "mirror.tuna.tsinghua.edu.cn"

123 echo "mirror.tuna.tsinghua.edu.cn 101.6.15.130" >>/etc/hosts;

124 cat /etc/hosts;

125 yum -y install zabbix-server-mysql zabbix-web-mysql

[zabbix]

name=Zabbix Official Repository - $basearch

baseurl=https://mirror.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/$basearch/

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591

[zabbix-non-supported]

name=Zabbix Official Repository non-supported - $basearch

baseurl=https://mirror.tuna.tsinghua.edu.cn/zabbix/non-supported/rhel/7/$basearch/

enabled=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX

gpgcheck=1

安装数据库

MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;

MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by '123456';

导入数据:

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

主机名和密码更改一下,其他2个即用户和数据库库名已存在zabbix

启动zabbix

systemctl disable firewalld --now

Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

更改时区:
vi /etc/httpd/conf.d/zabbix.conf

启动http服务,开机自启http服务

访问前段网页:

Admin zabbix