监控工具zabbix简介
Zabbix 是一个基于 WEB界面 的提供 分布式 系统监视以及网络监视功能的企业级的开源解决方案,简单的环境有两部分构成,zabbix server与可选组件zabbix agent;分布式环境有3部分构成:zabbix-server、zabbix-proxy、zabbix-agent;可以通过SNMP,zabbix agent,ping,端口监视等方法提供对远程服务器/网络状态的监视,数据收集等功能,它可以运行在Linux,Solaris,HP-UX,AIX,Free BSD,Open BSD,OS X等平台上
搭建分布式zabbix监控
注:本文档基于centos7
zabbix-server安装
导入zabbix官方yum源,方便我们进行yum安装
1 | [root@localhost ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm |
安装zabbix-server和mariadb
1 | [root@localhost ~]# yum install zabbix-server-mysql zabbix-web-mysql mariadb mariadb-server |
启动mariadb 初始化mariadb
1 | [root@localhost ~]# systemctl start mariadb |
导入zabbix初始化sql
1 | [root@localhost ~]# zcat /usr/share/doc/zabbix-server-mysql-3.4.0/create.sql.gz |mysql -uzabbix -pzabbix zabbix |
配置zabbix链接mysql,修改以下几项
1 | vim /etc/zabbix/zabbix_server.conf |
配置php参数,与下列保持一致
1 | vim /etc/httpd/conf.d/zabbix.conf |
启动httpd zabbix-server
1 | [root@localhost ~]# systemctl status httpd |
zabbix web配置
访问zabbix web页面
zabbix 会检查环境,如果有某项不能满足条件,会红色标出
配置mysql host user passwd
依次下一步 直到安装完成
登录,默认用户名密码为Admin zabbix
修改界面为中文
为了大脑不用太费劲,我们把界面调成中文显示,3.4已经对中文显示支持的非常好了
保存后退出重新登录,你发现界面已经变成中文了
zabbix-agent 安装配置(zabbix-server)
安装zabbix-agent
1 | [root@localhost ~]# yum install zabbix-agent -y |
配置zabbix-agent,主要修改以下几项
1 | [root@localhost ~]# vim /etc/zabbix/zabbix_agentd.conf |
启动zabbix-agent
1 | ● zabbix-agent.service - Zabbix Agent |
在web页面添加主机
配置主机
主机名称为 配置文件中hostname所配置的值 可见名称可取有意义的任何名字,IP地址为安装zabbix_agent的被监控主机的ip,端口默认为10050 关于代理现在暂时未涉及,暂时忽略,保持默认
为主机新增监控模板,可以输入输入关键字进行模糊搜索 最后点击更新即可
- 本文作者: ChuLinx
- 本文链接: http://yoursite.com/2019/11/30/zabbix安装配置-基于zabbix_3.4/
- 版权声明: 本博客所有文章除特别声明外,均采用 MIT 许可协议。转载请注明出处!