zabbix服务器端通过与zabbix agent通信来获取客户端服务器的数据,agent分为两个版本,在配置主机我们可以看到一个是agent,另一个是agent(active)。 agent:zabbix server向zabbix agent讨要数据。
agent(active):zabbix agent提交数据给zabbix server。
监控项keys列表
以下表格是zabbix agent所支持的所有key列表,添加一向监控的时候,首先想到的应该是zabbix agent是否已经有相关的key存在,而不是自己去写脚本来获取key。
agent.hostname
返回被监控端名称(字符串)
agent.ping
检测被监控端是否存活(1:运行中 其他:未运行)-使用函数 nodata()检测客户端是否正在运行
agent.version
zabbix agent版本字符串
kernel.maxfiles
系统支持最大的open files整数
kernel.maxproc
系统支持最大的进程数量整数
log[file,,,,,]
监控日志文件
file - 文件详细路径
regexp - 正则
encoding - 编码
maxlines - zabbix agent向server或者proxy发送最大的行数。
这个参数覆盖配置文件zabbxi_agentd.conf中的’MaxLinesPerSecond’
mode - 可选值:all (默认), skip (跳过处理老数据).mode参数从2.0版本开始支持
output - 可选项,输出格式模板.
示例: log[/var/log/syslog] log[/var/log/syslog,error] log[/home/zabbix/logs/logfile,,,100]
logrt[file_pattern,,,,,]
Monitoring of log file with log rotation support.
file_pattern - 文件绝对路径
net.dns[,zone,,,]
检测DNS服务是否开启0 – DNS挂了 1 - DNS运行中
ip - DNS服务器的ip地址(留空表示使用本地DNS, ignored onWindows)
zone - 需要测试的域名
type - 记录类型 (默认为 SOA),type可选值: ANY, A, NS, CNAME, MB, MG, MR, PTR, MD, MF, MX, SOA, NULL, WKS (除了windows), HINFO, MINFO, TXT, SRV SRV
timeout (ignored on Windows) – 超时时间(默认1秒)
count (ignored on Windows) – 重试次数 (默认值2)
示例key: net.dns[8.8.8.8,zabbix.com,MX,2,1]
net.dns.record[,zone,,,]
执行一个DNS查询获取DNS查询数据.
ip - DNS服务器的ip地址(留空表示使用本地DNS, ignored on Windows)
zone - 需要测试的域名
type - 记录类型 (默认SOA,可选值同net.dns)
timeout (ignored on Windows) – 超时时间(默认1秒)
count (ignored on Windows) – 重试次数 (默认值2)
示例key: net.dns.record[8.8.8.8,ttlsa.com,MX,2,1]
net.if.collisions[if]
Out-of-window collision.Number of collisions. Integer.if - 网卡
net.if.discovery
列出网卡.通常用于低级别的discovery.JSON对象
net.if.in[if,]
网卡入口流量整数.
if - 网卡名称
mode - 可用值: bytes - 字节数 (默认)
packets - 包数量
errors - 错误数量
dropped - 丢包数量
示例keys: net.if.in[eth0,errors] net.if.in[eth0]
net.if.out[if,]</