1. 开始
Simple checks通常用来检查远程未安装代理或者客户端的服务
使用simple checks,被监控客户端无需安装zabbix agent客户端,zabbix server直接使用simple checks来收据数据,一基本上都是用来检测远程服务器某端口是否在监听。
如下为simple checks:
net.tcp.service[ftp,,155]
net.tcp.service[http]
net.tcp.service.perf[http,,8080]
使用基本检测去监控vmware服务器,需要填写User和Password字段,其他服务器可以忽略
2. 基本检测
以下列表为zabbx支持的基本检测
Simple check支持的监控项:
Key | |||||
| 描述 | 返回值 | 参数 | 注释 | |
| |||||
icmpping[<target>,<packets>,<interval>,<size>,<timeout>] | |||||
| 主机可通过ICMP ping访问。 | 0 - ICMP ping失败 | target - 主机IP或者DNS名 | 示例: | |
| |||||
icmppingloss[<target>,<packets>,<interval>,<size>,<timeout>] | |||||
| 丢失数据包的百分比。 | Float. | target - 主机IP或者DNS名 | 可参考: 默认值表(见下文)。 | |
| |||||
icmppingsec[<target>,<packets>,<interval>,<size>,<timeout>,<mode>] | |||||
| ICMP ping响应时间(以秒为单位)。 | Float. | target - 主机IP或DNS名 | 如果主机不可用(达到超时),则该监控项将返回0。 | |
| |||||
net.tcp.service[service,<ip>,<port>] | |||||
| 检查服务是否正在运行并接受TCP连接。 | 0 - 服务停止 | service - 可能的值: ssh, ldap, smtp, ftp, http, pop, nntp, imap, tcp, https, telnet (参考细节) | 示例: | |
| |||||
net.tcp.service.perf[service,<ip>,<port>] | |||||
| 检查TCP服务的性能。 | 0 - 服务不可用 | service - 可能的值: ssh, ldap, smtp, ftp, http, pop, nntp, imap, tcp, https, telnet (参考详细信息) | 示例: | |
| |||||
net.udp.service[service,<ip>,<port>] | |||||
| 检查服务是否正在运行并响应UDP请求。 | 0 - 服务停了 | service - 可能的值: ntp (参考详细信息) | 示例: | |
| |||||
net.udp.service.perf[service,<ip>,<port>] | |||||
| 检查UDP服务的性能。 | 0 - 服务停止 | service - 可能的值: ntp (参考详细信息) | 示例: |
超时处理
如果基本检测时间超过了zabbix配置文件设置的超市时间,zabbix将不会做处理
3. ICMP pings
zabbix使用外部命令fling处理ICMP ping. fping不包含在zabbix的发行版本中,你需要额外去下载安装,如果你配置了epel源,如下命令安装
yum install fping -y
然后修改zabbix_server.conf,指定fping路径,配置参数为FpingLocation,一般为
1 | FpingLocation=/usr/bin/fping |
如果没有安装fping或者fping路径指定出错,cmpping, icmppingloss,icmppingsec都不会处理,执行fping命令的zabbix用户要设置setuid,毕竟fping命令是需要root权限的,如下设置:
1 2 | # chown root:zabbix /usr/sbin/fping # chmod 4710 /usr/sbin/fping |
ICMP检测默认参数:
参数 | 值 | 描述 | fping flag | Min | Max |
packets | 3 | 包数量 | -C | 1 | 10000 |
interval | 1000 | 毫秒, “fping” 默认 | -p | 20 | |
size | 56 or 68 | 字节, “fping” 默认; x86使用56字节, x86_64使用68字节 | -b | 24 | 65507 |
timeout | 500 | 毫秒, “fping” 默认 | -t | 50 | |