zabbix软件组成
zabbix-server: 监控服务端
zabbix-agent: 监控客户端
zabbix-web: 监控 站服务
php: 处理动态请求
mysql: 数据库存储监控数据
zabbix: 负责收集agent信息汇总告知zabbix-server
关闭防火墙和selinux
setenforce 0
sed -ri ‘/^SELINUX=/cSELINUX=disabled’ /etc/sysconfig/selinux
systemctl stop firewalld ; systemctl disable firewalld
在清华源下载镜像
https://mirrors.tuna.tsinghua.edu.cn/
添加zabbix源和epel源
下载安装
rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
安装zabbix和相关服务组建
数据库用my-sql所以用zabbix-web-mysql
–下载 zabbix-server-mysql
wget https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/{zabbix-server-mysql-4.0.20-1.el7.x86_64.rpm,zabbix-web-4.0.22-1.el7.noarch.rpm}
–安装 zabbix-server-mysql
yum install -y httpd php zabbix-server-mysql-4.0.20-1.el7.x86_64.rpm zabbix-web-mysql
–安装mariadb数据库软件
yum install -y mariadb-server
systemctl enable mariadb
数据库配置
–初始化数据库
systemctl start mariadb
mysql_secure_installation
(enter for none): 密码为空,直接回车
Set root passwordY/N]y 设置root 密码
Remove anonymous usersY/n]y 删除匿名用户
Disallow root login remotelyY/N]Y 允许远程登录
Remove test database….[Y/N] n 跳过测试库删除
Reload privilege tables now [Y/N] Y重新加载表权限
–进入数据库
mysql -uroot -p
–创建数据库
create database zabbix character set utf8 collate utf8_bin;
–zabbix用户赋权
grant all privileges on zabbix.* to zabbix@localhost identified by ‘123456’
退出 quit
–导入zabbix初始架构数据 回
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Enter password:123456
配置zabbix连接数据库
–配置zabbix数据库密码
sed -ri.bak ‘/# DBPassword=/cDBPassword=123456’ /etc/zabbix/zabbix_server.conf
或者
vim /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=123456
–配置时区
sed -ri.bak ‘s/ #(.*)date.timezone.*/1date.timezone Asia/Shanghai/’ /etc/httpd/conf.d/zabbix.conf
启动zabbix-server
systemctl start zabbix-server.service
systemctl enable zabbix-server.service
ss -ntpl |grep Zabbix
启动httpd服务
systemctl start httpd
systemctl enable httpd
重启mariadb数据库
systemctl restart mariadb
web访问
http://host/zabbix/setup.php
后续补充 被监控端部署
文章知识点与官方知识档案匹配,可进一步学习相关知识MySQL入门技能树安装和登录安装31759 人正在系统学习中 相关资源:GLONASS卫星位置计算与程序实现_葛奎_glonass_卫星位置__matlab…
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!