zabbix agent 类型所有key
原文轉(zhuǎn)自:http://www.ttlsa.com/zabbix/zabbix-agent-types-and-all-keys/
zabbix服務(wù)器端通過與zabbix agent通信來獲取客戶端服務(wù)器的數(shù)據(jù),agent分為兩個(gè)版本,其中一個(gè)是主動(dòng)一個(gè)是被動(dòng),在配置主機(jī)我們可以看到一個(gè)是agent,另一個(gè)是agent(active)。前者為被動(dòng)檢測,后者為主動(dòng)檢測。那么主動(dòng)和被動(dòng)區(qū)別在哪里呢?
被動(dòng):zabbix server向zabbix agent討要數(shù)據(jù)。
主動(dòng):zabbix agent提交數(shù)據(jù)給zabbix server。
監(jiān)控項(xiàng)keys列表
以下表格是zabbix agent所支持的所有.請(qǐng)大家一一過目,認(rèn)識(shí)他們就行,不需要背下來。
?
?
| Key | ||||
| 功能 | 返回值 | 參數(shù) | 描述 | |
| agent.hostname | ||||
| ? | ? | - | ? | |
| agent.ping | ||||
| ? | ? | ? | ? | |
| agent.version | ||||
| zabbix agent版本 | 字符串 | - | 例如返回: 1.8.2 | |
| kernel.maxfiles | ||||
| 系統(tǒng)支持最大的openfiles | 整數(shù) | ? | ? | |
| kernel.maxproc | ||||
| 系統(tǒng)支持最大的進(jìn)程數(shù)量 | 整數(shù) | ? | ? | |
| log 下載地址 | ||||
| 監(jiān)控日志文件 | Log | file?– 文件詳細(xì)路徑regexp – 正則encoding?– 編碼
maxlines?– zabbix agent向server或者proxy發(fā)送最大的行數(shù)。這個(gè)參數(shù)覆蓋配置文件zabbxi_agentd.conf中的’MaxLinesPerSecond’ mode?– 可選值: all (默認(rèn)), skip (跳過處理老數(shù)據(jù)).mode參數(shù)從2.0版本開始支持 output?– 可選項(xiàng),輸出格式模板. The \0 escape sequence is replaced with the matched text while an \N(where N=1…9) escape sequence is replaced with Nth matched group (or an empty string if the N exceeds the number of captured groups). If <output> is left empty – the whole line containing the matched text is returned. Note that all global regular expression types except ‘Result is TRUE’ always return the whole matched line and the <output> parameter is ignored. output是2.2中新加入的功能 | 這個(gè)監(jiān)控項(xiàng)只能設(shè)置為 active check(主動(dòng)模式).如果文件不存在或者沒有相應(yīng)的權(quán)限,那么監(jiān)控項(xiàng)狀態(tài)會(huì)轉(zhuǎn)變?yōu)閡nsupported.示例:
log[/var/log/syslog] log[/var/log/syslog,error] log[/home/zabbix/logs/logfile,,,100] | |
| logrt[file_pattern,<regexp>,<encoding>,<maxlines>,<mode>,<output>] | ||||
| 監(jiān)控支持輪轉(zhuǎn)的日志 | Log | file_pattern?– 文件絕對(duì)路徑regexp – 正則表達(dá)式encoding?– 編碼
maxlines?– 客戶端每秒發(fā)送給server的最大行數(shù). 這個(gè)參數(shù)會(huì)覆蓋客戶端配置文件zabbix_agentd.conf中MaxLinesPerSecond的值 mode?– 可選值: all (默認(rèn)), skip (跳過老數(shù)據(jù)的處理). Mode參數(shù)從2.0開始支持 output?– an optional output formatting template. The \0 escape sequence is replaced with the matched text while an \N(where N=1…9) escape sequence is replaced with Nth matched group (or an empty string if the N exceeds the number of captured groups). If <output> is left empty – the whole line containing the matched text is returned. Note that all global regular expression types except ‘Result is TRUE’ always return the whole matched line and the <output> parameter is ignored. The output parameter is supported from version 2.2. | The item must be configured as an active check. Log rotation is based on the last modification time of files.示例:logrt[“/home/zabbix/logs/^logfile[0-9]{1,3}$”,,,100]
– will match a file like “l(fā)ogfile1″ (will not match “.logfile1″) ? logrt[“/home/user/logfile_.*_[0-9]{1,3}”,”pattern_to_match”,”UTF-8″,100] – will collect data from files such “l(fā)ogfile_abc_1” or “l(fā)ogfile__001”. | |
| net.dns[<ip>,zone,<type>,<timeout>,<count>] | ||||
| 檢測DNS服務(wù)是否開啟 | 0 – DNS掛了 1 – DNS運(yùn)行中 | ip?– DNS服務(wù)器的ip地址(留空表示使用本地DNS, ignored on?Windows)zone – 需要測試的域名type?– 記錄類型 (默認(rèn)為 SOA)
timeout?(ignored on Windows) – 超時(shí)時(shí)間(默認(rèn)1秒) count?(ignored on Windows) – 重試次數(shù) (默認(rèn)值2) | 示例key:net.dns[8.8.8.8,zabbix.com,MX,2,1]type可選值: ANY, A, NS, CNAME, MB, MG, MR, PTR, MD, MF, MX, SOA, NULL, WKS (除了windows), HINFO, MINFO, TXT, SRV
SRV記錄從Zabbix agent versions 1.8.6 (Unix) and 2.0.0 (Windows)開始支持Zabbix 2.0 之前的命名方式: net.tcp.dns(目前依舊支持) | |
| net.dns.record[<ip>,zone,<type>,<timeout>,<count>] | ||||
| 執(zhí)行一個(gè)DNS查詢 | 獲取DNS查詢數(shù)據(jù) | ip?– DNS服務(wù)器的ip地址(留空表示使用本地DNS, ignored on Windows)zone – 需要測試的域名type?– 記錄類型 (默認(rèn)為 SOA)
timeout?(ignored on Windows) – 超時(shí)時(shí)間(默認(rèn)1秒) count?(ignored on Windows) – 重試次數(shù) (默認(rèn)值2) | 示例key:net.dns.record[8.8.8.8,ttlsa.com,MX,2,1]type的可選值: ANY, A, NS, CNAME, MB, MG, MR, PTR, MD, MF, MX, SOA, NULL, WKS (except for Windows), HINFO, MINFO, TXT, SRV
SRV記錄從Zabbix agent versions 1.8.6 (Unix) and 2.0.0 (Windows)開始支持Zabbix 2.0 之前的命名方式: net.tcp.dns(目前依舊支持) | |
| net.if.collisions[if] | ||||
| Out-of-window collision | Number of collisions | 數(shù)字 | if – 網(wǎng)卡 | |
| net.if.discovery | ||||
| 列出網(wǎng)卡. 通常用于低級(jí)別的discovery | JSON對(duì)象 | ? | Zabbix agent 2.0開始支持 但是操作系統(tǒng)FreeBSD, OpenBSD and NetBSD上的 Zabbix agent 2.2開始支持 | |
| net.if.in[if,<mode>] | ||||
| 網(wǎng)卡入口流量 | 整數(shù) | if?– 網(wǎng)卡名稱mode – 可用值:bytes?– 字節(jié)數(shù) (默認(rèn))
packets?– 包數(shù)量 errors?– 錯(cuò)誤數(shù)量 dropped?– 丟包數(shù)量 | 示例keys: net.if.in[eth0,errors] net.if.in[eth0]請(qǐng)使用增量存儲(chǔ)方式 | |
| net.if.out[if,<mode>] | ||||
| 網(wǎng)卡出口流量 | 整數(shù) | if?– 網(wǎng)卡名稱mode – 可用值:bytes?– 字節(jié)數(shù) (默認(rèn))
packets?– 包數(shù)量 errors?– 錯(cuò)誤數(shù)量 dropped?– 丟包數(shù)量 | 范例keys:net.if.out[eth0,errors] net.if.out[eth0]請(qǐng)使用增量存儲(chǔ)方式 | |
| net.if.total[if,<mode>] | ||||
| 網(wǎng)卡進(jìn)/出流量的總和 | 整數(shù) | if?– 網(wǎng)卡名稱mode – 可用值:bytes?– 字節(jié)數(shù) (默認(rèn))
packets?– 包數(shù)量 errors?– 錯(cuò)誤數(shù)量 dropped?– 丟包數(shù)量 | 范例keys:net.if.total[eth0,errors] net.if.total[eth0]請(qǐng)使用增量存儲(chǔ)方式 | |
| net.tcp.listen[port] | ||||
| 檢測端口是否開啟 | 0?– 未監(jiān)聽1?– 監(jiān)聽中 | port?– TCP端口 | 示例:net.tcp.listen[80]linux下的zabbix agent 1.8.4開始支持 | |
| net.tcp.port[<ip>,port] | ||||
| 是否可以連接到指定的TCP端口 | 0?– 無法連接1?– 可以連接 | ip?– IP地址(默認(rèn)是 127.0.0.1)port?– 端口 | 范例:net.tcp.port[,80]檢測web服務(wù)器端口是否運(yùn)行中
老命名方式: check_port[*] | |
| net.tcp.service[service,<ip>,<port>] | ||||
| 檢測服務(wù)是否開啟,并且端口可用 | 0 – 服務(wù)掛了1 – 服務(wù)運(yùn)行中 | service?– 如下: ssh, ntp, ldap, smtp, ftp, http, pop, nntp,imap, tcp, https, telnetip – IP地址 (默認(rèn)127.0.0.1)port?– 端口 (默認(rèn)情況為標(biāo)準(zhǔn)端口號(hào)) | 示例key:net.tcp.service[ftp,,45] – 檢測45端口上得FTP是否運(yùn)行中Zabbix 1.8.3 支持的版本請(qǐng)使用service.ntp 代替ntp.
https 和telnet 服務(wù)從2.0和2.2開始支持 | |
| net.tcp.service.perf[service,<ip>,<port>] | ||||
| 檢測服務(wù)器性能 | 0 – 服務(wù)掛了;seconds – 鏈接到服務(wù)器端口消耗的時(shí)間 | service?– 如下:ssh, ntp, ldap, smtp, ftp, http, pop, nntp,imap, tcp, https, telnetip – IP地址 (默認(rèn)127.0.0.1)port?– 端口 (默認(rèn)情況為標(biāo)準(zhǔn)端口號(hào)) | 示例key:net.tcp.service.perf[ssh] – 檢測SSH服務(wù)器響應(yīng)速度加密協(xié)議檢測不被支持 (類似 IMAP端口 993或者POP端口995) .但是我們可以使用net.tcp.service.perf[tcp,<ip>,<port>] 來檢測他們.Windows agent不能檢測LDAP和HTTPS. Note that the telnet check looks for a prompt (‘:’ at the end).老命名方式: check_service_perf[*]注意:that before Zabbix 1.8.3 version service.ntp should be used instead of ntp. Zabbix 2.0支持 https和telnet服務(wù) | |
| net.udp.listen[port] | ||||
| 檢測UDP端口是否在監(jiān)聽 | 0?– 未監(jiān)聽1?– 監(jiān)聽中 | port?– udp端口 | 范例:net.udp.listen[68]linux系統(tǒng)的Zabbix agent 1.8.4開始支持 | |
| proc.mem[<name>,<user>,<mode>,<cmdline>] | ||||
| 用戶進(jìn)程消耗的內(nèi)存 | 內(nèi)存使用量 (字節(jié)單位). | name?– 進(jìn)程名 (默認(rèn)值 “all processes”)user – 用戶名 (默認(rèn)值“all users”)mode?– 可選值: avg, max, min, sum (默認(rèn))
cmdline?– 命令行過濾(正則表達(dá)時(shí)) | 示例keys:proc.mem[,root]– root的進(jìn)程消耗了多少內(nèi)存
proc.mem[zabbix_server,zabbix] – zabbix用戶運(yùn)行的zabbix_server使用了多少內(nèi)存 proc.mem[,oracle,max,oracleZABBIX] – memory used by the most memory-hungry process running under oracle having oracleZABBIX in its command line | |
| proc.num[<name>,<user>,<state>,<cmdline>] | ||||
| 某用戶某些狀態(tài)的進(jìn)程的數(shù)量 | 進(jìn)程數(shù)量 | name?– 進(jìn)程名稱 (默認(rèn)“all processes”)user – 用戶名 (默認(rèn) “all users”)state?– 可用值: all (默認(rèn)), run,sleep, zomb
cmdline?– 命令行過濾(正則表達(dá)時(shí)) | 示例keys: proc.num[,mysql]– MySQL用戶運(yùn)行的進(jìn)程數(shù)量
proc.num[apache2,www-data] – www-data運(yùn)行了多少個(gè)apache2進(jìn)程proc.num[,oracle,sleep,oracleZABBIX] – number of processes in sleep state running under oracle having oracleZABBIX in its command line 備注:Windows系統(tǒng)只支持name和user兩個(gè)參數(shù) | |
| sensor[device,sensor,<mode>] | ||||
| 讀取硬件傳感器 | ? | device?– 設(shè)備名稱sensor – 傳感器名稱mode?– 可選值: avg,
max, min (if this parameter is omitted, device and sensor are treated verbatim). On Linux 2.4, 讀取/proc/sys/dev/sensors. | 示例key:sensor[w83781d-i2c-0-2d,temp1] Prior to Zabbix 1.8.4, the sensor[temp1] format was used. On Linux 2.6+, 讀取/sys/class/hwmon. On OpenBSD, 讀取hw.sensors MIB.示例keys:
sensor[cpu0,temp0] – CPU0的溫度 sensor[cpu[0-2]$,temp,avg] – cpu平均溫度 Zabbix 1.8.4開始支持OpenBSD | |
| system.boottime | ||||
| 系統(tǒng)啟動(dòng)的時(shí)間鹺 | 整數(shù) | ? | unix時(shí)間戳 | |
| system.cpu.intr | ||||
| 設(shè)備中斷 | 整數(shù) | ? | ? | |
| system.cpu.load[<cpu>,<mode>] | ||||
| CPU負(fù)載 | 浮點(diǎn)數(shù) | cpu?– 可用值: all (默認(rèn)), percpu (所有在線cpu的負(fù)載)mode?– 可用值: avg1 (1分鐘 默認(rèn)值), avg5(5分鐘平均), avg15 (15分鐘平均值) | 范例key:system.cpu.load[,avg5]老命令方式: system.cpu.loadX
參數(shù)percpu is Zabbix 2.0.0開始支持 | |
| system.cpu.num[<type>] | ||||
| CPU數(shù)量 | 處理器個(gè)數(shù) | type?– 可用值: online (默認(rèn)值), max | 范例:system.cpu.num | |
| system.cpu.switches | ||||
| 上下文交換 | 交換次數(shù) | ? | 老命名方式: system[switches] | |
| system.cpu.util[<cpu>,<type>,<mode>] | ||||
| CPU利用率 | 百分比 | cpu?– cpu數(shù)量 (默認(rèn)是所有cpu)type – 可用值: idle, nice, user (默認(rèn)), system (windows系統(tǒng)默認(rèn)值), iowait, interrupt, softirq,stealmode?– 可用值: avg1 (一分鐘平均,默認(rèn)值), avg5(5分鐘平均, avg15 (15分鐘平均值) | 范例key:system.cpu.util[0,user,avg5]老命名方式:
system.cpu.idleX, system.cpu.niceX, system.cpu.systemX, system.cpu.userX | |
| system.hostname[<type>] | ||||
| 返回主機(jī)名 | 字符串 | type?(僅用于windows系統(tǒng)) – 可用值: netbios(默認(rèn)) or host | 例如:on Linux: system.hostname → linux-w7x1 system.hostname → www.zabbix.com on Windows: system.hostname → WIN-SERV2008-I6 system.hostname[host] → Win-Serv2008-I6LonG type參數(shù)從zabbix 1.8.6開始支持 | |
| system.hw.chassis[<info>] | ||||
| 返回機(jī)架信息 | 字符串 | info?– full (默認(rèn)), model, serial, type 或vendor | 例如: system.hw.chassis[full] Hewlett-Packard HP Pro 3010 Small Form Factor PC CZXXXXXXXX Desktop] 需要root權(quán)限,因?yàn)檫@些信息是從內(nèi)存中讀取的。 Zabbix agent version 2.0 開始支持 | |
| system.hw.cpu[<cpu>,<info>] | ||||
| 返回CPU信息 | 字符/數(shù)字 | cpu?– cpu數(shù)量或者all (默認(rèn))info –?full?(默認(rèn)), curfreq, maxfreq, model 或者vendor | 例如:system.hw.cpu[0,vendor]AuthenticAMD 從/proc/cpuinfo、/sys/devices/system/cpu/[cpunum]/cpufreq/cpuinfo_max_freq獲取信息. 如果指定了CPU數(shù)量和 curfreq或者maxfreq, 將會(huì)返回?cái)?shù)值(Hz).
Zabbix agent 2.0 開始支持 | |
| system.hw.devices[<type>] | ||||
| 列出PCI或者USB | 文本值 | type?– pci (默認(rèn)) or usb | 范例:system.hw.devices[pci]00:00.0 Host bridge: Advanced Micro Devices [AMD] RS780 Host Bridge [..] 返回lspci或者lsusb (不帶參數(shù))
Zabbix agent 2.0開始支持 | |
| system.hw.macaddr[<interface>,<format>] | ||||
| 列出MAC地址 | 字符串 | interface?– all (默認(rèn)) 或者正則表達(dá)式format?– full (默認(rèn)) 、short | 范例:system.hw.macaddr[“eth0$”,full][eth0] 00:11:22:33:44:55 列出指定接口mac地址 如果format指定為short,MAC地址相同的將會(huì)被忽略掉
Zabbix agent 2.0開始支持 | |
| system.localtime[<type>] | ||||
| 系統(tǒng)時(shí)間 | 數(shù)字或者字符串 | utc?– (默認(rèn)) (00:00:00 UTC, January 1, 1970)local?– 本地時(shí)間格式 ‘yyyy-mm-dd,hh:mm:ss.nnn,+hh:mm’ | zabbix 2.0開始支持帶參數(shù) | |
| system.run[command,<mode>] | ||||
| 在制定的主機(jī)上運(yùn)行命令 | 文本 | command?– 命令mode?– wait (默認(rèn)值, 執(zhí)行超時(shí)時(shí)間), nowait (不等待) ????? 最大可用返回512KB數(shù)據(jù),包含空白數(shù)據(jù)。命令輸出數(shù)據(jù)必須是文本 | 例如:system.run[ls -l /]– 列出/的文件和目錄.
備注: 啟用這個(gè)方法, agent配置文件必須配置 EnableRemoteCommands=1選項(xiàng) | |
| system.stat[resource,<type>] | ||||
| 虛擬內(nèi)存狀態(tài) | 數(shù)字 | ent - number of processor units this partition is entitled to receive (float)kthr,<type> - information about kernel thread states:r - average number of runnable kernel threads (float)
b - average number of kernel threads placed in the Virtual Memory Manager wait queue (float) memory,<type> - information about the usage of virtual and real memory: avm - active virtual pages (integer) fre - size of the free list (integer) page,<type> - information about page faults and paging activity: fi - file page-ins per second (float) fo - file page-outs per second (float) pi - pages paged in from paging space (float) po - pages paged out to paging space (float) fr - pages freed (page replacement) (float) sr - pages scanned by page-replacement algorithm (float) faults,<type> - trap and interrupt rate: in - device interrupts (float) sy - system calls (float) cs - kernel thread context switches (float) cpu,<type> - breakdown of percentage usage of processor time: us - user time (float) sy - system time (float) id - idle time (float) wa - idle time during which the system had outstanding disk/NFS I/O request(s) (float) pc - number of physical processors consumed (float) ec - the percentage of entitled capacity consumed (float) lbusy - indicates the percentage of logical processor(s) utilization that occurred while executing at the user and system level (float) app - indicates the available physical processors in the shared pool (float) disk,<type> - disk statistics: bps - indicates the amount of data transferred (read or written) to the drive in bytes per second (integer) tps - indicates the number of transfers per second that were issued to the physical disk/tape (float) This item is supported starting from version 1.8.1. | ||
| system.sw.arch | ||||
| 返回軟件信息 | 字符串 | ? | 范例:system.sw.arch i686數(shù)據(jù)來自u(píng)name方法
Zabbix agent 2.0.開始支持 | |
| system.sw.os[<info>] | ||||
| 返回系統(tǒng)信息 | 字符串 | info?– full (default), short ,name | 范例:system.sw.os[short]Ubuntu 2.6.35-28.50-generic 2.6.35.11
信息來自如下文件 [full] – /proc/version [short] – /proc/version_signature [name] – /etc/issue.net Zabbix agent version 2.0.開始支持 | |
| system.sw.packages[<package>,<manager>,<format>] | ||||
| 已安裝軟件列表 | 文本值 | package?– all (默認(rèn))或者正則表達(dá)式manager – all (默認(rèn)) or a package managerformat?– full (默認(rèn)) ,short | 范例:system.sw.packages[mini,dpkg,short]?python-minimal, python2.6-minimal, ubuntu-minimal Lists (alphabetically) installed packages whose names match the given package regexp (“all” lists them all).包管理:
manager (執(zhí)行命令) dpkg (dpkg –get-selections) pkgtool (ls /var/log/packages) rpm (rpm -qa) pacman (pacman -Q) 如果format 為full, packages are grouped by package managers (each manager on a seperate line beginning with it’s name in square brackets). 如果format為short, 包不分組,并且都列在一行上. Zabbix agent 2.0開始支持 | |
| system.swap.in[<device>,<type>] | ||||
| 交換分區(qū)IN(磁盤交換到內(nèi)存) | 數(shù)字 | device?– 交換分區(qū)設(shè)備 (默認(rèn)all)type?– 可選值: count (swapins數(shù)量), sectors(sectors swapped in), pages (pages swapped in). | 示例key:system.swap.in[,pages]數(shù)據(jù)采集自: Linux 2.4: /proc/swaps, /proc/partitions, /proc/stat
Linux 2.6: /proc/swaps, /proc/diskstats, /proc/vmstat | |
| system.swap.out[<device>,<type>] | ||||
| Swap out (f內(nèi)存到磁盤) | 數(shù)字 | device?– swap設(shè)備 (默認(rèn)all)type?– possible values: count (number of swapouts), sectors(sectors swapped out), pages (pages swapped out). See supported by platformfor details on defaults. | 示例key:system.swap.out[,pages]數(shù)據(jù)采集自:
Linux 2.4: /proc/swaps, /proc/partitions, /proc/stat Linux 2.6: /proc/swaps, /proc/diskstats, /proc/vmstat | |
| system.swap.size[<device>,<type>] | ||||
| 交換分區(qū)大小 | 字節(jié)或者百分比 | device?– 交換分區(qū) (默認(rèn)值 all)type?– possible values: free (free swap space, default), pfree (free swap space, in percent), pused (used swap space, in percent), total (total swap space), used (used swap space) | 示例 key:system.swap.size[,pfree]– 空閑swap百分比
老命名格式: system.swap.free, system.swap.total | |
| system.uname | ||||
| 返回主機(jī)相信信息 | 字符串 | ? | 示例值:FreeBSD localhost 4.2-RELEASEFreeBSD 4.2-RELEASE #0: Mon Nov i386
Since Zabbix 2.2.0, the value for this item is obtained by using the uname() system call, whereas previously it was obtained by invoking “uname -a” on Unix systems. Hence, the value of this item might differ from the output of “uname -a” and does not include additional information that “uname -a” | |
| system.uptime | ||||
| 系統(tǒng)運(yùn)行時(shí)長(秒) | 多少秒 | ? | 使用s/uptime來獲取 | |
| system.users.num | ||||
| 登陸用戶數(shù)量 | 多少用戶 | ? | agent使用who命令獲取 | |
| vfs.dev.read[<device>,<type>,<mode>] | ||||
| 磁盤讀取狀態(tài) | 整數(shù)(如果type為如下): sectors,operations,bytes 浮點(diǎn)數(shù)(如果type為如下): sps, ops,bps | device?– 磁盤設(shè)備 (默認(rèn)值 “all”1)type?– 可選值: sectors, operations, bytes, sps, ops, bps(必須指定, 不同操作系統(tǒng)下不同). sps, ops, bps stand for: sectors, operations, bytes per second, respectively mode – 可選值: avg1 (一分平均, 默認(rèn)值), avg5(五分內(nèi)平均), avg15 (15分內(nèi)平均值). 備注: 只有type為sps, ops, bps的時(shí)候,第三個(gè)參數(shù)才被支持。不同操作系統(tǒng)的TYPE參數(shù): FreeBSD – bps
Linux – sps OpenBSD – operations Solaris – bytes | 示例key:vfs.dev.read[,operations]老命名方式: io[*]
Usage of the type parameters ops, bps and sps on supported platforms used to be limited to 8 devices (7 individual devices and one “all”). Starting with Zabbix 2.0.1 this limit has been increased to 1024 (1023 individual devices and one for “all”). Zabbix 1.8.6開始支持LVM Until Zabbix 1.8.6, only relative device names may be used (for example, sda), since 1.8.6 an optional /dev/ prefix may be used (for example, /dev/sda) | |
| vfs.dev.write[<device>,<type>,<mode>] | ||||
| 磁盤寫入狀態(tài) | 整數(shù)(如下類型): sectors,operations,bytes 浮點(diǎn)型(如下類型): sps, ops,bps | device?– 磁盤設(shè)備 (默認(rèn)值 “all”1)type – sectors, operations, bytes, sps, ops, bps (must specify exactly which parameter to use, since defaults are different under various OSes). sps, ops, bps means: sectors, operations, bytes per second respectively ??mode– one of avg1 (default),avg5 (average within 5 minutes), avg15. Note: The third parameter is supported only if the type is in: sps, ops, bps. | Default values of ‘type’ parameter for different OSes: FreeBSD – bps Linux – sps OpenBSD – operations Solaris – bytes Example: vfs.dev.write[,operations] Old naming: io[*] The type parameters ops, bps and sps on supported platforms used to be limited to 8 devices (7 individual devices and one “all”). Starting with Zabbix 2.0.1 this limit has been increased to 1024 (1023 individual devices and one for “all”). Supports LVM since Zabbix 1.8.6. Until Zabbix 1.8.6, only relative device names may be used (for example, sda), since 1.8.6 optional /dev/ prefix may be used (for example, /dev/sda) | |
| vfs.file.cksum 下載地址 | ||||
| 計(jì)算文件校驗(yàn) | File checksum, calculated by algorithm used by UNIX cksum | file?– 文件完整路徑 | 例如,返回值: 1938292000例如:
vfs.file.cksum[/etc/passwd] 老命名規(guī)范: cksum | |
| vfs.file.contents 下載地址 | ||||
| 獲取文本內(nèi)容 | Contents of a file or empty string if it is empty or it contains only LF/CR characters | file?– 文件完整路徑 | 例如:vfs.file.contents[/etc/passwd]文件不可以超過64KB.
Zabbix agent 2.0開始支持 | |
| vfs.file.exists 下載地址 | ||||
| 檢測文件是否存在 | 1 – 文件/硬鏈接/軟連接文件存在 0 – 不存在 | file?– 文件完整路徑 | 例如:vfs.file.exists[/tmp/application.pid] | |
| vfs.file.md5sum 下載地址 | ||||
| 文件MD5校驗(yàn)碼 | 文件MD5哈希值 | file?– 完整路徑 | 示例返回值:b5052decb577e0fffd622d6ddc017e82 示例:vfs.file.md5sum[/usr/local/etc/zabbix_agentd.conf]
1.8.6移除了64MB文件大小的限制 | |
| vfs.file.regexp 下載地址 | ||||
| 文件中搜索字符串 | 包含字符串的行,或者為空 | file?– 文件完整路徑regexp – GNU正則表達(dá)encoding?– 編碼
start line?– 從哪一行開始,默認(rèn)第一行 end line?– 從哪一行結(jié)束,默認(rèn)最后一行 output?– an optional output formatting template. The \0 escape sequence is replaced with the matched text while an \N(where N=1…9) escape sequence is replaced with Nth matched group (or an empty string if the N exceeds the number of captured groups). 如果 <output> 為空, 所有包含搜索字符串的行都會(huì)被返回 start line和end line從zabbix 2.0開始支持 | 僅返回首先匹配的行例如:vfs.file.regexp[/etc/passwd,zabbix]
vfs.file.regexp[/path/to/some/file,”([0-9]+)$”,,3,5,\1] vfs.file.regexp[/etc/passwd,^zabbix:.:([0-9]+),,,,\1] – getting the ID of user zabbix | |
| vfs.file.regmatch 下載地址 | ||||
| 文件中搜索字符串 | 0 – 為找到1 – 找到 | file?– 文件完整路徑regexp – GNU 正則表達(dá)式encoding?– 編碼
start line?– 哪行開始,默認(rèn)第一行 end line?– 哪行結(jié)束,默認(rèn)最后一行 上面兩個(gè)參數(shù)從 2.0版本開始支持。 | 例如:vfs.file.regmatch[/var/log/app.log,error] | |
| vfs.file.size 下載地址 | ||||
| 文件大小 | 字節(jié) | file?– 完整路徑 | zabbix必須有可讀此文件的權(quán)限例如:vfs.file.size[/var/log/syslog] | |
| vfs.fs.discovery | ||||
| 列出掛載的文件系統(tǒng) | Used for low-level discovery | JSON對(duì)象 | 從zabbix agent 2.0開始支持 | |
| vfs.fs.inode[fs,<mode>] | ||||
| inodes數(shù)量 | 數(shù)字 | fs?– 文件系統(tǒng)mode?– total (默認(rèn)), free, used, pfree (空閑百分比), pused (使用百分比) | 例如:vfs.fs.inode[/,pfree]老命名規(guī)則:
vfs.fs.inode.free[*], vfs.fs.inode.pfree[*], vfs.fs.inode.total[*] | |
| vfs.fs.size[fs,<mode>] | ||||
| 磁盤空間 | 字節(jié) | fs?– 文件系統(tǒng)mode?– total (默認(rèn)), free, used, pfree (空閑百分比), pused (使用百分比) | 返回本地文件系統(tǒng)的使用量.例如: vfs.fs.size[/tmp,free]老命名規(guī)則: vfs.fs.free[*], vfs.fs.total[*], vfs.fs.used[*], vfs.fs.pfree[*], vfs.fs.pused[*],*是任意掛載點(diǎn) | |
| vm.memory.size[<mode>] | ||||
| 內(nèi)存大小 | 字節(jié)或者百分比 | mode?– total (默認(rèn)), active, anon, buffers, cached, exec, file, free, inactive, pinned, shared, wired, used, pused, available, available其中挑一個(gè) | 老命名規(guī)則: vm.memory.buffers, vm.memory.cached, vm.memory.free, vm.memory.shared, vm.memory.total監(jiān)控項(xiàng)vm.memory.size[]允許三種類型的參數(shù)
第一類:包含total – 總內(nèi)存 第二類: 系統(tǒng)指定內(nèi)存類型:active, anon, buffers, cached, exec, file, free, inactive,pinned, shared, wired. 第三類:用戶級(jí)別,一共使用了多少內(nèi)存,還有多少內(nèi)存可用: used, pused, available,pavailable. | |
| web.page.get[host,<path>,<port>] | ||||
| 獲取網(wǎng)頁內(nèi)容 | 網(wǎng)頁源代碼 | host?– 主機(jī)名/域名path – 文件地址,默認(rèn)/port?– 端口,默認(rèn)80 | 返回空字符串表示失敗. 例如:web.page.get[www.ttlsa.com,/,80] | |
| web.page.perf[host,<path>,<port>] | ||||
| 獲取完全加載網(wǎng)頁消耗的時(shí)長 | 秒 | host?– 主機(jī)名/域名path – html地址,默認(rèn)是/port?– 端口,默認(rèn)80 | 返回0表示失敗. 例如: web.page.perf[www.ttlsa.com,/,80] | |
| web.page.regexp[host,<path>,<port>,<regexp>,<length>,<output>] | ||||
| 在網(wǎng)頁中搜索字符串 | The matched string, or as specified by the optional<output>parameter. An empty string if no match was found. | host?– 主機(jī)名path – html文件路徑 (默認(rèn)值 /)port?– 端口 (默認(rèn)80)
regexp?– GNU正則表達(dá)式 length?– 返回的最大的字符串?dāng)?shù)量 output?– 輸出格式模板可選項(xiàng). The \0 escape sequence is replaced with the matched text while an \N(where N=1…9) escape sequence is replaced with Nth matched group (or an empty string if the N exceeds the number of captured groups). If <output> is left empty – the whole line containing the matched text is returned. The output parameter is supported from version 2.2. | 失敗則返回空字符 (不匹配).示例:web.page.regexp[www.zabbix.com,index.php,80,OK,2] | |
| vfs.file.time 下載地址 | ||||
| 文件時(shí)間 | Unix時(shí)間戳. | file?– 文件路徑mode?- one of modify (default, modification time), access - last access time, change - last change time | 示例:vfs.file.time[/etc/passwd,modify]
The file size limit depends on large file support. | |
| ? | ? | ? | ? | ? |
?
總結(jié)
以上是生活随笔為你收集整理的zabbix agent 类型所有key的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SaltStack 第二板块安装说明 [
- 下一篇: 单峰数组找最大元素C语言,查找单峰数组中