開始
Simple checks 一般用來檢查遠程未安裝代理或者客戶端的服務。 使用 simple checks,被監控客戶端無需安裝 zabbix
agent 客戶端, zabbix server 直接使用 simple checks 來收據數據,一基本上都是用來檢測遠程服務器某端口是否在
監聽。
chrome
以下爲simple checks:
net.tcp.service[ftp,,155]
net.tcp.service[http]
net.tcp.service.perf[http,,8080]服務器
使用基本檢測去監控vmware服務器,須要填寫User和Password字段,其餘服務器能夠忽略ssh
如下列表爲zabbx支持的基本檢測tcp
Key | ||||
描述 | 返回值 | 參數 | Comments | |
icmpping[<target>,<packets>,<interval>,<size>,<timeout>] | ||||
檢測是否支持icmpping | 0 - ICMP ping失敗1 - ICMP ping 成功 | target - 主機IP或者域名packets - 包數量interval - 連續的數據包之間的時間間隔,以毫秒爲單位 size - 包大小,以字節爲單位 timeout - 超時時間,以毫秒爲單位 | 例如: icmpping[,4] - 4個包只要一個有返回,那麼將會返回1 See also details of processing ICMP pings. | |
icmppingloss[<target>,<packets>,<interval>,<size>,<timeout>] | ||||
返回百分比 | 丟包率 | target - 目標IP或者域名 packets - 包個數 interval - 連續包之間的時間間隔,以毫秒爲單位 size - 包大小,字節爲單位timeout - 超市時間,毫秒爲單位 | 請參考 details of processing ICMP pings. | |
icmppingsec[<target>,<packets>,<interval>,<size>,<timeout>,<mode>] | ||||
返回ICMP響應時間 | 秒 | target - 主機IP或者域名 packets - 包個數 interval - 包得響應時間,毫秒爲單位 size - 包大小,字節爲單位 timeout - 超時時間,毫秒爲單位 mode - min, max, avg (默認值) | .若是主機不可用,好比掛掉了,那麼會返回0 | |
net.tcp.service[service,<ip>,<port>] | ||||
檢測服務是否運行而且接受tcp鏈接 | 0 - 服務未開啓1 - 服務運行中 | service - ssh, ntp, ldap, smtp, ftp, http, pop, nntp, imap, tcp, https, telnet中的一個 ip - zabbix中定義好的ip port - 端口(標準服務端口). | 範例: net.tcp.service[ftp,,45] 檢測運行在端口號45的FTP服務是否可用.加密協議imap993端口和pop995端口目前不支持zabbix 2.0開始支持https和telnet | |
net.tcp.service.perf[service,<ip>,<port>] | ||||
檢測服務器性能. | 0 - 服務中止sec - 鏈接到服務器的時間(秒) | service - ssh, ntp, ldap, smtp, ftp, http, pop, nntp, imap, tcp, https, telnet之一 ip - zabbix中定義的IP port - 端口(標準端口號) | 例如: net.tcp.service.perf[ssh] 能夠檢測鏈接到ssh所消耗的時間. Note that with tcp service indicating the port is mandatory.加密協議服務不支持,例如IMAPzabbix 2.0開始支持https和telnetide |
超時處理
若是基本檢測時間超過了zabbix配置文件設置的超市時間,zabbix將不會作處理.性能
zabbix使用外部命令fling處理ICMP ping. fping不包含在zabbix的發行版本中,你須要額外去下載安裝,若是你配置了epel源,以下命令安裝測試
[root@localhost ~]# yum install fping Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.163.com * updates: mirrors.163.com base | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 google-chrome | 1.3 kB 00:00:00 opera | 2.9 kB 00:00:00 updates | 3.4 kB 00:00:00 zabbix | 2.9 kB 00:00:00 zabbix-non-supported | 951 B 00:00:00 Package fping-3.10-1.el7.x86_64 already installed and latest version Nothing to do
而後修改zabbix_server.conf,指定fping路徑,配置參數爲FpingLocation,通常爲ui
FpingLocation=/usr/sbin/fping
若是沒有安裝fping或者fping路徑指定出錯,cmpping, icmppingloss,icmppingsec都不會處理,執行fping命令的zabbix用戶要設置setuid,畢竟fping命令是須要root權限的,以下設置:google
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 |
若是使用Simple checks
第一次使用,能夠先測試下能不能使用fping命令
[root@localhost ~]# fping 192.168.1.107 192.168.1.107 is alive
建立item時type類型選擇 Simple check而後Key選擇對應key並填上對應參數便可。
能夠在lastest data看到