Zabbix监控基础配置<1>--服务端、客户端部署

一、安装与配置zabbix

需要设置如下网络源:
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $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=0
yum install zabbix-server
zabbix-server : zabbix-server-mysql
yum install -y mariadb-server
systemctl enable --now mariadb

%建立数据库zabbix、建立数据库用户zabbix、授权
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql>create user 'zabbix'@'localhost' identified by 'westos';
mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost';

%将数据导入到zabbix库中
zcat /usr/share/doc/zabbix-server-mysql-4.0.27/create.sql.gz | mysql -uzabbix -pwestos zabbix

%编写配置文件
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=westos

%设置zabbix-server开机自启(server端)
systemctl enable --now zabbix-server

yum install -y zabbix-agent
systemctl enable --now zabbix-agent    %agent负责节点数据采集

注意:主机的selinux和防火墙都要关闭
相关官方文档:
https://www.zabbix.com/documentation/4.0/zh/manual/appliance.
https://www.zabbix.com/documentation/4.0/manual/appendix/install/db_scripts.

二、登录与相关用户配置

server端:
yum install -y zabbix-web-mysql php-bcmath-5.4.16-46.el7.x86_64.rpm php-mbstring-5.4.16-46.el7.x86_64.rpm
vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai 修改时区
systemctl enable --now httpd

完成上述操作后就可访问到zabbix的web界面访问方式为:server端ip地址/zabbix
之后输入数据库用户密码(之前设置的),输入zabbix server:localhost zabbix server port:10051 zabbix server name:zabbix
之后再输入用户名 Admin 以及密码 zabbix 登陆zabbix管理界面,此时身份为管理员,可以进行任意配置
在这里插入图片描述
在这里插入图片描述

三、agent端配置

在另一台主机中:
yum install zabbix-agent
vim /etc/zabbix/zabbix_agentd.conf
Server=10.4.17.101
Hostname=server2 (本主机主机名)
systemctl restart zabbix-agent.service

注意:同样要关闭selinux和防火墙并且做好解析

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值