zabbix proxy

zabbix proxy

https://www.zabbix.com/documentation/4.0/zh/manual/concepts/proxy
Zabbix proxy 是一个可以从一个或多个受监控设备采集监控数据并将信息发送到 Zabbix server 的进程,主要是代表 Zabbix server 工作。 所有收集的数据都在本地缓存,然后传输到 proxy 所属的 Zabbix server。 部署 Zabbix proxy 是可选的,但可能非常有利于分担单个 Zabbix server 的负载。 如果只有代理采集数据,则 Zabbix server 上会减少 CPU 和磁盘 I/O 的开销。(主机多的情况下,使用zabbix proxy是一种很好的优化方案) Zabbix proxy 需要使用独立的数据库
应用场景 多机房:在两个或以上的机房环境中,无法通过一台zabbix server对agent进行有效的实时的监控。 主机多:主机数量数百上千台。一台zabbix server无法承受如此之大的工作量。 网络隔离:网络之间互相隔离,一台zabbix server无法与所有agent的网络相连接。

主动和被动(这里指的是agent)

被动模式

zabbix server 根据策略指定的时间主动发送请求给zabbix agent获取监控项,agent收集完数据并发送给zabbix server,在百台服务器环境下不能及时获取新的数据 对zabbix server 来说是主动模式 对zabbix agent来说是被动模式,默认模式

主动模式

zabbix agent和zabbix server 第一次建立连接后,获取监控项后,周期性主动向zabbix server发送数据,监控项也会根据策略周期性同步,不再需要zabbix serve进行干预,因此主动模式在一定程度上可减轻zabbix server的压力 对zabbix server 来说是被动模式 对zabbix agent来说是主动模式

安装proxy

zabbix agent 采集数据给 zabbix proxy ,proxy可将数据缓存并发送给server
对于proxy来说,被动模式效率较低

安装zabbix proxy

proxy 主动模式

创建主动模式数据库

修改配置文件

启动zabbix proxy服务

web添加proxy

notion image
notion image
克隆一套模板并修改主动模式
notion image
notion image
Template OS Linux Active –> 监控项 –> 全选 –> 批量更新
notion image
notion image

修改模板自动发现规则

将默认被动模式修改为主机模式,更新时间可根据实际情况修改
notion image
notion image
notion image
notion image
监控项原型也需要修改
notion image
notion image

添加/修改一台主机到proxy中

notion image
notion image
notion image

修改agent配置

此时数据是通过proxy采集过来的

notion image

proxy 被动模式

创建被动模式数据库

修改配置文件

启动zabbix proxy服务

修改agent配置

serveractive 在Proxy被动模式下不生效

web添加proxy

notion image

添加一台主机到proxy中

notion image
notion image
此过程有点慢,需要等待一段时间,大约在30分钟
notion image
notion image

查看proxy采集的数据

notion image

小结

proxy一般用于跨机房或者跨网段 被动模式应用较少,效率较低 proxy被动模式,agent也是被动模式,连接大约在30分钟
关于agent主动与被动排查问题 1、找错误日志,没有开DEBUG 2、检查网络 3、检查进程 4、检查配置文件ServerActive指向正常的server/proxy,确保是主动模式 5、zabbix server 与 zabbix agent 版本是否兼容 6、参考:HostMetadataItem=system.uname 7、其他可能性
关于zabbix web查看主机zbx图标不亮,主动模式 1、其他可以忽略,主模式模式,agent主动发数据给server,可忽略客户端端口 2、可添加agent配置文件active允许server/proxy连接,监听端口打开 3、采集器数量是否合理分配
zabbix agent active –> zabbix proxy passive –> zabbix server
notion image
notion image
Loading...