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


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


在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


[参考]
相关文章
|
监控 关系型数据库 Linux
zabbix在configure时候遇到的问题
zabbix在configure时候遇到的问题(CentOS)为你解答: 在CentOS系统中,安装zabbix进行configure时会遇到以下4个主要问题 .
945 0
|
监控 网络协议 关系型数据库
|
3月前
|
存储 SQL 监控
修改Zabbix源码实现监控数据双写,满足业务需求!
虽然对接Elasticsearch后有诸多好处,但是它不往数据库写历史数据了,同时还不再计算趋势数据了。有这么一个场景...
修改Zabbix源码实现监控数据双写,满足业务需求!
|
4月前
|
数据采集 监控 数据库
OceanBase社区版可以通过Zabbix监控
OceanBase社区版可以通过Zabbix监控
75 4