在开篇之前又来废话一下,今天这个教程也是基于现有项目需要,做服务器运维监控,由于项目紧,任务重,运维监控也是重中之重,运维监控确保系统是否正常运营,由于政府项目比较特殊,网络原因以及环境原因,这里结合使用到了proxy来代替server收集信息,具体项目拓扑这里就不做过多的解释。
zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。
zabbix能监视各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题。
zabbix由2部分构成,zabbix server与可选组件zabbix agent。
zabbix server可以通过SNMP,zabbix agent,ping,端口监视等方法提供对远程服务器/网络状态的监视,数据收集等功能,它可以运行在Linux,Solaris,HP-UX,AIX,Free BSD,Open BSD,OS X等平台上。
https://www.zabbix.com/
192.168.177.145 Zabbix Server
192.168.177.146 Zabbix Agent
192.168.177.147 Zabbix Agent1
192.168.177.148 Zabbix Proxy
注意:这里zabbix server和zabbix proxy是同一个网段下,zabbix proxy有两块网卡,一个是177,一个是110网段 ,110网段的agent数据收集通过proxy代理进行收集信息,在一定时间内,批量上传至server,这样可以避免频繁访问server端,对服务器造成压力
阿里:wget http://mirrors.aliyun.com/repo/Centos-7.repo
163:wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
yum install epel-release
yum -y install “Development Tools”
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
yum clean all
systemctl stop firewalld
yum install zabbix-server-mysql zabbix-web-mysql
yum -y install mariadb-server
systemctl start mariadb.service
systemctl status mariadb.service
ps aux | grep mysql
运行mysql_secure_installation命令对其做下操作
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix@somnus123';
flush privileges;
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pzabbix@somnus123 zabbix
/etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix@somnus123
systemctl start zabbix-server.service
systemctl start zabbix-server.service
vi /etc/php.ini
max_execution_time = 300
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
max_input_vars = 10000
always_populate_raw_post_data = -1
date.timezone = Asia/Shanghai
systemctl start httpd.service
systemctl status httpd.service
账号:Admin
密码:zabbix
yum -y install zabbix-proxy-mysql
create database zabbix_proxy character set utf8 collate utf8_bin;
grant all privileges on zabbix_proxy.* to zabbix@localhost identified by 'zabbix@somnus123';
flush privileges;
rpm -ql zabbix-proxy-mysql
zcat /usr/share/doc/zabbix-proxy-mysql-4.0.25/schema.sql.gz | mysql -uzabbix -pzabbix@somnus123 zabbix_proxy
vi /etc/zabbix/zabbix_proxy.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix@somnus123
Server=192.168.177.145
Hostname=sd-proxy
修改配置文件,进行修改完毕之后进行重启
systemctl start zabbix-proxy.service
systemctl status zabbix-proxy.service
yum -y install zabbix-agent
6.1启动zabbix agent
systemctl start zabbix-agent
systemctl status zabbix-agent
vi /etc/zabbix/zabbix_agent.conf
Server=192.168.177.148
Hostname=zabbix
简书原文博客:CentOS手把手教你搭建Zabbix Server,Zabbix Proxy,Zabbix Agent企业级监控平台