码迷,mamicode.com
首页 > 其他好文 > 详细

CentOS7安装Zabbix4.0.19

时间:2020-04-15 00:28:50      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:火墙   zip   repo   数据库连接   isa   load   centos7   防火墙   back   

环境:
CentOS-7.6-x86_64-minimal
系统安装完毕后关闭selinux这坑货
setenforce 0
sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/‘ /etc/selinux/config

先更新系统
yum -y install wget vim-enhanced
mkdir /etc/yum.repos.d/backup
mv /etc/yum.repos.d/{*.repo,backup}
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.163.com/.help/CentOS7-Base-163.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
rpm -ivh https://mirror.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
rm -rf /var/cache/yum
rm -rf /var/cache/man
yum makecache
yum -y update

1.安装zabbix
yum -y install zabbix-web-mysql zabbix-server-mysql mariadb-server
2.启动并初始化mariadb
systemctl start mariadb.service
systemctl enable mariadb.service
systemctl status mariadb.service
mysql_secure_installation

3.创建zabbix数据库
mysql -uroot -p
create database zabbix character set utf8 collate utf8_bin;
grant all on zabbix.* to zabbix@localhost identified by ‘123456‘;

4.导入zabbix数据库
cd /usr/share/doc/zabbix-server-mysql-4.0.19
gzip -d create.sql.gz
mysql -uzabbix -p123456 zabbix <create.sql

5.配置zabbix_server内数据库连接
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=123456

6.配置时区
配置vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai

7.防火墙放行80端口或者实验环境下关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service
或者
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --query-port=80/tcp
firewall-cmd --reload

8.启动httpd和zabbix-server
systemctl start httpd zabbix-server.service
systemctl enable httpd zabbix-server.service
systemctl status httpd zabbix-server.service

9.浏览器输入http://ip/zabbix
进行相关设置后即可登入。

10.主机localhost监控
直接安装zabbix-agent
yum -y install zabbix-agent
systemctl start zabbix-agent

11.远程Linux主机监控
yum -y install zabbix-agent
vim /etc/zabbix/zabbix_agentd.conf
第95行Server后面敲逗号,附加上zabbix监控server端的IP地址,然后启动或重启zabbix-agent
在zabbix-server的GUI端进行主机添加。

CentOS7安装Zabbix4.0.19

标签:火墙   zip   repo   数据库连接   isa   load   centos7   防火墙   back   

原文地址:https://blog.51cto.com/12114052/2487263

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!