zabbix agentd configure

简介:
在被监控的主机, 需要有一个zabbix的agent来负责将监控数据发送给proxy或直接发送给server.
同时agentd也支持监听, proxy和server可以主动要求agent调用监控命令. 但是在安全性要求较高的环境, 一般不开启agent的被动模式, 只使用主动模式, 即agent主动往外发监控数据, 但是不接受任何远程调用. 
两种模式的运行机制 : 
In a passive check the agent responds to a data request. Zabbix server (or proxy) asks for data, for example, CPU load, and Zabbix agent sends back the result.

Active checks require more complex processing. The agent must first retrieve a list of items from Zabbix server for independent processing. Then it will periodically send new values to the server.
详见

server和proxy的配置参考 : 
本文假设我们要将监控数据发送给proxy. 
配置agentd.conf如下, 连接到proxy.
# vi /opt/zabbix/etc/zabbix_agentd.conf

PidFile=/tmp/zabbix_agentd.pid
LogFile=/tmp/zabbix_agentd.log
LogFileSize=10
EnableRemoteCommands=0
StartAgents=0
ServerActive=172.16.3.150:10052
Hostname=agent150
RefreshActiveChecks=120
AI 代码解读


启动agentd
# useradd zabbix_agent
[root@150 etc]# su - zabbix_agent -c "zabbix_agentd -c /opt/zabbix/etc/zabbix_agentd.conf"
AI 代码解读


在zabbix WEB 添加主机, 注意主机名和agentd.conf Hostname配置一致.
zabbix agentd configure - 德哥@Digoal - PostgreSQL research

添加监控模板.
zabbix agentd configure - 德哥@Digoal - PostgreSQL research

重启proxy, 因为proxy是从server获取配置的, 所以必须重启获取刚才添加的主机. 否则agent会报找不到主机的错误.
如下 : 
 33315:20140901:155115.763 no active checks on server [172.16.3.150:10052]: host [agent221] not found
 33315:20140901:155315.787 no active checks on server [172.16.3.150:10052]: host [agent221] not found

[被动相关配置]
zabbix_agentd.conf
需开启监听, 允许远程调用, Server配置一个列表, 表示允许被哪些远程的服务端IP连接本agent.

PidFile=/tmp/zabbix_agentd.pid
LogFile=/tmp/zabbix_agentd.log
LogFileSize=10
EnableRemoteCommands=1
LogRemoteCommands=1
Server=172.16.3.150
ListenPort=10050
ListenIP=0.0.0.0
StartAgents=8
ServerActive=172.16.3.150:10052
Hostname=agent150
RefreshActiveChecks=120
AI 代码解读


[参考]
目录
打赏
0
0
0
0
20695
分享
相关文章
zabbix在configure时候遇到的问题
zabbix在configure时候遇到的问题(CentOS)为你解答: 在CentOS系统中,安装zabbix进行configure时会遇到以下4个主要问题 .
1007 0
【案例分享】中国通号卡斯柯公司:ZABBIX如何破解轨道交通监控难题
本文根据2023上海峰会上朱林贤的演讲整理,聚焦中国通号卡斯柯公司如何借助Zabbix实现轨道交通信号系统的智能化管理。作为中外合资企业,卡斯柯通过统一平台整合设备监控,大幅降低成本并提升灵活性,成功应用于国内外项目。文章探讨了传统监控系统的痛点、研发维护经验及国产化与开源技术挑战,为行业转型提供了宝贵启示。未来,开放协作将是推动轨道交通智能化发展的关键。
38 0

热门文章

最新文章

推荐镜像

更多
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等