zabbix安装

iso:centos7.9mini

 

1.1 关闭SeLinux
setenforce 0          #临时关闭

vi /etc/selinux/config
#永久关闭:关闭SELINUX
SELINUX=disabled

1.2 关闭firewalld
systemctl stop firewalld.service          #临时关闭firewalld
systemctl disable firewalld.service       #永久关闭firewalld

1.3 安装apache
yum install httpd       #使用yum安装httpd
systemctl enable httpd     #设置开机自启httpd
systemctl start httpd      #开启httpd服务
systemctl status httpd     #查看httpd服务状态

af47271438c631d22649ee7273d5d8e3.png 1.4 安装mysql
yum install mariadb mariadb-server    #yum安装mariadb
systemctl enable mariadb        #设置开机自启服务
systemctl start mariadb         #开机mariadb服务
systemctl status mariadb        #查看mariadb状态

 

 

1.5 安装php环境
yum install php php-mysql 

1.6 安装zabbix
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

#这里我遇到了一个报错,提示找不到这些包,我们可以更改为阿里源试下

报错如下:

解决如下:

[root@ceshi yum.repos.d]# cat zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
#baseurl=http://repo.zabbix.com/zabbix/3.4/rhel/7/$basearch/
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/3.4/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=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1

yum install zabbix-server-mysql zabbix-get zabbix-web zabbix-web-mysql zabbix-agent zabbix-sender  #再次安装

8d517b763e26fcd02534d9e3d48efc3f.png 8f7800ba7f81d6446a9a47f8ddbef0ae.png

 

创建一个zabbix库并设置为utf8的字符编码格式

create database zabbix character set utf8 collate utf8_bin;

创建账户并且授权设置密码
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';

flush privileges;

导入表
cd /usr/share/doc/zabbix-server-mysql-3.4.15/

进行解压
gunzip create.sql.gz

 #进入mysql17931ecd67620ab3cebac28f2bf3724a.png

 

1.7 配置zabbix server配置文件
#配置文件目录

cd /etc/zabbix/
[root@ceshi zabbix]# ls
web  zabbix_agentd.conf  zabbix_agentd.d  zabbix_server.conf

#对zabbix_server.conf进行配置
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBSocket=/var/lib/mysql/mysql.socka4335a0ae5f350851a040c99b82fc920.pnge686c0a03b0df5b36032573cfc481110.png

 开机自启zabbix-server服务
systemctl start zabbix-server   #开启服务
systemctl enable zabbix-server  #设置开机自启
systemctl status zabbix-server  #查看服务状态

1.8 配置php
cd /etc/httpd/conf.d

[root@ceshi conf.d]# ls
autoindex.conf  php.conf  README  userdir.conf  welcome.conf  zabbix.conf

vi zabbix.conf

# php_value date.timezone Europe/Riga
php_value date.timezone Asia/Shanghai1d42a904c366f7aab0edd0bb6e6c83ae.png

1.8 登陆zabbix网址设置
https://192.168.3.30/zabbix

 9415c7d312fcf7bbd90e2f389f706ed0.png

操作如下:

输入我们之前设置的密码:zabbix

默认用户:Admin

默认密码:zabbix 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

阿呆~耶~

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值