Zabbix Documentation 3.0

2.23.04.0 (current)In development:4.2 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


manual:config:items:itemtypes:zabbix_agent

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:config:items:itemtypes:zabbix_agent [2018/08/10 13:04]
martins-v inserting line breaks
manual:config:items:itemtypes:zabbix_agent [2019/01/25 09:12] (current)
martins-v formatting change
Line 42: Line 42:
 | ||||| | |||||
 ^log[file,<​regexp>,<​encoding>,<​maxlines>,<​mode>,<​output>​] ​ ^^^^^ ^log[file,<​regexp>,<​encoding>,<​maxlines>,<​mode>,<​output>​] ​ ^^^^^
-^ |Log file monitoring. ​ |Log  |**file** - full path and name of log file\\ **regexp** - regular expression describing the required pattern\\ **encoding** - code page [[:​manual/​config/​items/​itemtypes/​zabbix_agent#​available_encodings|identifier]]\\ **maxlines** - maximum number of new lines per second the agent will send to Zabbix server or proxy. This parameter overrides the value of '​MaxLinesPerSecond'​ in [[manual:​appendix:​config:​zabbix_agentd|zabbix_agentd.conf]]\\ **mode** - possible values:\\ //all// (default), //skip// - skip processing of older data (affects only newly created items).\\ **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). ​ |The item must be configured as an [[manual:​appendix:​items:​activepassive#​active_checks|active check]].\\ If file is missing or permissions do not allow access, item turns unsupported.\\ \\ 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.\\ \\ Content extraction using the ''​output''​ parameter takes place on the agent.\\ \\ Examples:\\ => log[/​var/​log/​syslog]\\ => log[/​var/​log/​syslog,​error]\\ => log[/​home/​zabbix/​logs/​logfile,,,​100]\\ \\ //Example of using ''​output''​ parameter for extracting a number from log record://\\ %%log[/​app1/​app.log,"​task run [0-9.]+ sec, processed ([0-9]+) records, [0-9]+ errors",,,,​\1]%%->​ %%will match a log record "​2015-11-13 10:08:26 task run 6.08 sec, processed 6080 records, 0 errors"​ and send only number 6080 to server. Because a number is being sent, the "Type of information"​ for this log item can be changed from "​Log"​ to "​Numeric (unsigned)"​ and the value can be used in graphs, triggers etc.%% \\ \\ //Example of using ''​output''​ parameter for rewriting log record before sending to server:// \\ %%log[/​app1/​app.log,"​([0-9 :-]+) task run ([0-9.]+) sec, processed ([0-9]+) records, ([0-9]+) errors",,,,"​\1 RECORDS: \3, ERRORS: \4, DURATION: \2"​]%%->​ %%will match a log record "​2015-11-13 10:08:26 task run 6.08 sec, processed 6080 records, 0 errors+^ |Log file monitoring. ​ |Log  |**file** - full path and name of log file\\ **regexp** - regular expression describing the required pattern\\ **encoding** - code page [[:​manual/​config/​items/​itemtypes/​zabbix_agent#​available_encodings|identifier]]\\ **maxlines** - maximum number of new lines per second the agent will send to Zabbix server or proxy. This parameter overrides the value of '​MaxLinesPerSecond'​ in [[manual:​appendix:​config:​zabbix_agentd|zabbix_agentd.conf]]\\ **mode** - possible values:\\ //all// (default), //skip// - skip processing of older data (affects only newly created items).\\ **output** - an optional output formatting template. The **\0** escape sequence is replaced with the matched ​part of text (from the first character where match begins until the character where match ends) 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). ​ |The item must be configured as an [[manual:​appendix:​items:​activepassive#​active_checks|active check]].\\ If file is missing or permissions do not allow access, item turns unsupported.\\ \\ 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.\\ \\ Content extraction using the ''​output''​ parameter takes place on the agent.\\ \\ Examples:\\ => log[/​var/​log/​syslog]\\ => log[/​var/​log/​syslog,​error]\\ => log[/​home/​zabbix/​logs/​logfile,,,​100]\\ \\ //Example of using ''​output''​ parameter for extracting a number from log record://\\ %%log[/​app1/​app.log,"​task run [0-9.]+ sec, processed ([0-9]+) records, [0-9]+ errors",,,,​\1]%%->​ %%will match a log record "​2015-11-13 10:08:26 task run 6.08 sec, processed 6080 records, 0 errors"​ and send only number 6080 to server. Because a number is being sent, the "Type of information"​ for this log item can be changed from "​Log"​ to "​Numeric (unsigned)"​ and the value can be used in graphs, triggers etc.%% \\ \\ //Example of using ''​output''​ parameter for rewriting log record before sending to server:// \\ %%log[/​app1/​app.log,"​([0-9 :-]+) task run ([0-9.]+) sec, processed ([0-9]+) records, ([0-9]+) errors",,,,"​\1 RECORDS: \3, ERRORS: \4, DURATION: \2"​]%%->​ %%will match a log record "​2015-11-13 10:08:26 task run 6.08 sec, processed 6080 records, 0 errors
 " and send a modified record "​2015-11-13 10:08:26 RECORDS: 6080, ERRORS: 0, DURATION: 6.08" to server.%% \\ \\ The ''​output''​ parameter is supported since Zabbix 2.2.\\ The ''​mode''​ parameter is supported since Zabbix 2.0.\\ \\ See also additional information on [[log_items|log monitoring]]. ​ | " and send a modified record "​2015-11-13 10:08:26 RECORDS: 6080, ERRORS: 0, DURATION: 6.08" to server.%% \\ \\ The ''​output''​ parameter is supported since Zabbix 2.2.\\ The ''​mode''​ parameter is supported since Zabbix 2.0.\\ \\ See also additional information on [[log_items|log monitoring]]. ​ |
 | ||||| | |||||
 ^logrt[file_regexp,<​regexp>,<​encoding>,<​maxlines>,<​mode>,<​output>​] ​ ^^^^^ ^logrt[file_regexp,<​regexp>,<​encoding>,<​maxlines>,<​mode>,<​output>​] ​ ^^^^^
-^ |Log file monitoring with log rotation support. ​ |Log  |**file_regexp** - absolute path to file and regexp describing the file name pattern\\ **regexp** - regular expression describing the required content pattern\\ **encoding** - code page [[:​manual/​config/​items/​itemtypes/​zabbix_agent#​available_encodings|identifier]]\\ **maxlines** - maximum number of new lines per second the agent will send to Zabbix server or proxy. This parameter overrides the value of '​MaxLinesPerSecond'​ in [[manual:​appendix:​config:​zabbix_agentd|zabbix_agentd.conf]]\\ **mode** - possible values:\\ //all// (default), //skip// - skip processing of older data (affects only newly created items).\\ **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). ​ |The item must be configured as an [[manual:​appendix:​items:​activepassive#​active_checks|active check]].\\ Log rotation is based on the last modification time of files.\\ \\ 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.\\ \\ Content extraction using the ''​output''​ parameter takes place on the agent.\\ \\ Examples:\\ => %%logrt["/​home/​zabbix/​logs/​^logfile[0-9]{1,​3}$",,,​100]%% -> %%will match a file like "​logfile1"​ (will not match "​.logfile1"​)%%\\ => %%logrt["/​home/​user/​^logfile_.*_[0-9]{1,​3}$","​pattern_to_match","​UTF-8",​100]%% -> %%will collect data from files such "​logfile_abc_1"​ or "​logfile__001"​.%%\\ \\ //Example of using ''​output''​ parameter for extracting a number from log record://\\ %%logrt[/​app1/​^test.*log$,"​task run [0-9.]+ sec, processed ([0-9]+) records, [0-9]+ errors",,,,​\1]%%->​ %%will match a log record "​2015-11-13 10:08:26 task run 6.08 sec, processed 6080 records, 0 errors"​ and send only number 6080 to server. Because a number is being sent, the "Type of information"​ for this log item can be changed from "​Log"​ to "​Numeric (unsigned)"​ and the value can be used in graphs, triggers etc.%% \\ \\ //Example of using ''​output''​ parameter for rewriting log record before sending to server:// \\ %%logrt[/​app1/​^test.*log$,"​([0-9 :-]+) task run ([0-9.]+) sec, processed ([0-9]+) records, ([0-9]+) errors",,,,"​\1 RECORDS: \3, ERRORS: \4, DURATION: \2"​]%%->​ %%will match a log record "​2015-11-13 10:08:26 task run 6.08 sec, processed 6080 records, 0 errors+^ |Log file monitoring with log rotation support. ​ |Log  |**file_regexp** - absolute path to file and regexp describing the file name pattern\\ **regexp** - regular expression describing the required content pattern\\ **encoding** - code page [[:​manual/​config/​items/​itemtypes/​zabbix_agent#​available_encodings|identifier]]\\ **maxlines** - maximum number of new lines per second the agent will send to Zabbix server or proxy. This parameter overrides the value of '​MaxLinesPerSecond'​ in [[manual:​appendix:​config:​zabbix_agentd|zabbix_agentd.conf]]\\ **mode** - possible values:\\ //all// (default), //skip// - skip processing of older data (affects only newly created items).\\ **output** - an optional output formatting template. The **\0** escape sequence is replaced with the matched ​part of text (from the first character where match begins until the character where match ends) 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). ​ |The item must be configured as an [[manual:​appendix:​items:​activepassive#​active_checks|active check]].\\ Log rotation is based on the last modification time of files.\\ \\ 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.\\ \\ Content extraction using the ''​output''​ parameter takes place on the agent.\\ \\ Examples:\\ => %%logrt["/​home/​zabbix/​logs/​^logfile[0-9]{1,​3}$",,,​100]%% -> %%will match a file like "​logfile1"​ (will not match "​.logfile1"​)%%\\ => %%logrt["/​home/​user/​^logfile_.*_[0-9]{1,​3}$","​pattern_to_match","​UTF-8",​100]%% -> %%will collect data from files such "​logfile_abc_1"​ or "​logfile__001"​.%%\\ \\ //Example of using ''​output''​ parameter for extracting a number from log record://\\ %%logrt[/​app1/​^test.*log$,"​task run [0-9.]+ sec, processed ([0-9]+) records, [0-9]+ errors",,,,​\1]%%->​ %%will match a log record "​2015-11-13 10:08:26 task run 6.08 sec, processed 6080 records, 0 errors"​ and send only number 6080 to server. Because a number is being sent, the "Type of information"​ for this log item can be changed from "​Log"​ to "​Numeric (unsigned)"​ and the value can be used in graphs, triggers etc.%% \\ \\ //Example of using ''​output''​ parameter for rewriting log record before sending to server:// \\ %%logrt[/​app1/​^test.*log$,"​([0-9 :-]+) task run ([0-9.]+) sec, processed ([0-9]+) records, ([0-9]+) errors",,,,"​\1 RECORDS: \3, ERRORS: \4, DURATION: \2"​]%%->​ %%will match a log record "​2015-11-13 10:08:26 task run 6.08 sec, processed 6080 records, 0 errors
 " and send a modified record "​2015-11-13 10:08:26 RECORDS: 6080, ERRORS: 0, DURATION: 6.08" to server.%% \\ \\ The ''​output''​ parameter is supported since Zabbix 2.2.\\ The ''​mode''​ parameter is supported since Zabbix 2.0.\\ \\ See also additional information on [[log_items|log monitoring]]. ​ | " and send a modified record "​2015-11-13 10:08:26 RECORDS: 6080, ERRORS: 0, DURATION: 6.08" to server.%% \\ \\ The ''​output''​ parameter is supported since Zabbix 2.2.\\ The ''​mode''​ parameter is supported since Zabbix 2.0.\\ \\ See also additional information on [[log_items|log monitoring]]. ​ |
 | ||||| | |||||
Line 148: Line 148:
 | ||||| | |||||
 ^system.stat[resource,<​type>​] ​ ^^^^^ ^system.stat[resource,<​type>​] ​ ^^^^^
-^ |System statistics. ​ |Integer or float  |**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 since Zabbix ​**1.8.1.**  ||+^ |System statistics. ​ |Integer or float  |**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) ​ || 
 +^ |:::​|:::​^Comments ​ || 
 +^ |:::|:::|This item is [[:​manual/​appendix/​items/​supported_by_platform|supported]] on AIX only, since Zabbix 1.8.1.\\ The following items are supported only on AIX LPAR of type "​Shared":​\\ => system.stat[cpu,​app]\\ => system.stat[cpu,​ec] (also on "​Dedicated"​ since Zabbix 3.0.23; always returns 100 (percent))\\ => system.stat[cpu,​lbusy]\\ => system.stat[cpu,​pc] (also on "​Dedicated"​ since Zabbix 3.0.23)\\ => system.stat[ent] (also on "​Dedicated"​ since Zabbix 3.0.23) ​ ||
 | ||||| | |||||
 ^system.sw.arch ​ ^^^^^ ^system.sw.arch ​ ^^^^^
Line 178: Line 180:
 | ||||| | |||||
 ^vfs.dev.read[<​device>,<​type>,<​mode>​] ​ ^^^^^ ^vfs.dev.read[<​device>,<​type>,<​mode>​] ​ ^^^^^
-^ |Disk read statistics. ​ |Integer - with ''​type''​ in //​sectors//,​ //​operations//,​ //bytes//\\ \\ Float - with ''​type''​ in //sps//, //ops//, //​bps// ​ |**device** - disk device (default is //all//) \\ **type** - possible values: //​sectors//,​ //​operations//,​ //bytes//, //sps//, //ops//, //bps//\\ This parameter must be specified, since defaults differ under various OSes.\\ //sps//, //ops//, //bps// stand for: sectors, operations, bytes per second, respectively.\\ **mode** - possible values: //avg1// (one-minute average, default), //avg5//, //​avg15//​.\\ This parameter is supported only with ''​type''​ in: sps, ops, bps.  |Default values of '​type'​ parameter for different OSes:\\ AIX - operations\\ FreeBSD - bps\\ Linux - sps\\ OpenBSD - operations\\ Solaris - bytes\\ \\ Example:\\ => vfs.dev.read[,​operations]\\ \\ //sps//, //ops// and //bps// on supported platforms used to be limited to 8 devices (7 individual and one //all//). Since Zabbix 2.0.1 this limit is 1024 devices (1023 individual and one for //all//).\\ \\ If default //all// is used for the first parameter then the key will return summary statistics, including all block devices like sda, sbd and their partitions (sda1, sda2, sdb3...) and multiple devices (MD raid) based on those block devices/​partitions and logical volumes (LVM) based on those block devices/​partitions. In such cases returned values should be considered only as relative value (dynamic in time) but not as absolute values.\\ \\ Supports LVM since Zabbix 1.8.6.\\ \\ Only relative device names could be used (for example, **sda**) until Zabbix 1.8.6. Since then, an optional **/dev/** prefix may be used (for example, **/​dev/​sda**).\\ \\ Old naming: //​io[*]// ​ |+^ |Disk read statistics. ​ |Integer - with ''​type''​ in //​sectors//,​ //​operations//,​ //bytes//\\ \\ Float - with ''​type''​ in //sps//, //ops//, //bps//\\ \\ //Note//: Since 3.0.25, if using an update interval of three hours or more<​sup>​**[[#​footnotes|2]]**</​sup>,​ will always return '​0' ​ ​|**device** - disk device (default is //​all// ​<​sup>​**[[#​footnotes|3]]**</​sup>​) \\ **type** - possible values: //​sectors//,​ //​operations//,​ //bytes//, //sps//, //ops//, //bps//\\ This parameter must be specified, since defaults differ under various OSes.\\ //sps//, //ops//, //bps// stand for: sectors, operations, bytes per second, respectively.\\ **mode** - possible values: //avg1// (one-minute average, default), //avg5//, //​avg15//​.\\ This parameter is supported only with ''​type''​ in: sps, ops, bps.  |You may use relative device names (for example, ''​sda''​) as well as an optional /dev/ prefix (for example, ''/​dev/​sda''​).\\ \\ LVM logical volumes are supported.\\ \\ Default values of '​type'​ parameter for different OSes:\\ AIX - operations\\ FreeBSD - bps\\ Linux - sps\\ OpenBSD - operations\\ Solaris - bytes\\ \\ Example:\\ => vfs.dev.read[,​operations]\\ \\ //sps//, //ops// and //bps// on supported platforms used to be limited to 8 devices (7 individual and one //all//). Since Zabbix 2.0.1 this limit is 1024 devices (1023 individual and one for //all//).\\ \\ Old naming: //​io[*]// ​ |
 | ||||| | |||||
 ^vfs.dev.write[<​device>,<​type>,<​mode>​] ​ ^^^^^ ^vfs.dev.write[<​device>,<​type>,<​mode>​] ​ ^^^^^
-^ |Disk write statistics. ​ |Integer - with ''​type''​ in //​sectors//,​ //​operations//,​ //bytes//\\ \\ Float - with ''​type''​ in //sps//, //ops//, //​bps// ​ |**device** - disk device (default is //all//) \\ **type** - possible values: //​sectors//,​ //​operations//,​ //bytes//, //sps//, //ops//, //bps//\\ This parameter must be specified, since defaults differ under various OSes.\\ //sps//, //ops//, //bps// stand for: sectors, operations, bytes per second, respectively.\\ **mode** - possible values: //avg1// (one-minute average, default), //avg5//, //​avg15//​.\\ This parameter is supported only with ''​type''​ in: sps, ops, bps.  |Default values of '​type'​ parameter for different OSes:\\ AIX - operations\\ FreeBSD - bps\\ Linux - sps\\ OpenBSD - operations\\ Solaris - bytes\\ \\ Example:\\ => vfs.dev.write[,​operations]\\ \\ //sps//, //ops// and //bps// on supported platforms used to be limited to 8 devices (7 individual and one //all//). Since Zabbix 2.0.1 this limit is 1024 (1023 individual and one for //all//).\\ \\ If default //all// is used for the first parameter then the key will return summary statistics, including all block devices like sda, sbd and their partitions (sda1, sda2, sdb3...) and multiple devices (MD raid) based on those block devices/​partitions and logical volumes (LVM) based on those block devices/​partitions. In such cases returned values should be considered only as relative value (dynamic in time) but not as absolute values.\\ \\ Supports LVM since Zabbix 1.8.6.\\ \\ Only relative device names could be used (for example, **sda**) until Zabbix 1.8.6. Since then, an optional **/dev/** prefix may be used (for example, **/​dev/​sda**).\\ \\ Old naming: //​io[*]// ​ |+^ |Disk write statistics. ​ |Integer - with ''​type''​ in //​sectors//,​ //​operations//,​ //bytes//\\ \\ Float - with ''​type''​ in //sps//, //ops//, //bps//\\ \\ //Note//: Since 3.0.25, if using an update interval of three hours or more<​sup>​**[[#​footnotes|2]]**</​sup>,​ will always return '​0' ​ ​|**device** - disk device (default is //​all// ​<​sup>​**[[#​footnotes|3]]**</​sup>​) \\ **type** - possible values: //​sectors//,​ //​operations//,​ //bytes//, //sps//, //ops//, //bps//\\ This parameter must be specified, since defaults differ under various OSes.\\ //sps//, //ops//, //bps// stand for: sectors, operations, bytes per second, respectively.\\ **mode** - possible values: //avg1// (one-minute average, default), //avg5//, //​avg15//​.\\ This parameter is supported only with ''​type''​ in: sps, ops, bps.  |You may use relative device names (for example, ''​sda''​) as well as an optional /dev/ prefix (for example, ''/​dev/​sda''​).\\ \\ LVM logical volumes are supported.\\ \\ Default values of '​type'​ parameter for different OSes:\\ AIX - operations\\ FreeBSD - bps\\ Linux - sps\\ OpenBSD - operations\\ Solaris - bytes\\ \\ Example:\\ => vfs.dev.write[,​operations]\\ \\ //sps//, //ops// and //bps// on supported platforms used to be limited to 8 devices (7 individual and one //all//). Since Zabbix 2.0.1 this limit is 1024 (1023 individual and one for //all//).\\ \\ Old naming: //​io[*]// ​ |
 | ||||| | |||||
 ^vfs.file.cksum[file] ​ ^^^^^ ^vfs.file.cksum[file] ​ ^^^^^
Line 196: Line 198:
 | ||||| | |||||
 ^vfs.file.regexp[file,​regexp,<​encoding>,<​start line>,<​end line>,<​output>​] ​ ^^^^^ ^vfs.file.regexp[file,​regexp,<​encoding>,<​start line>,<​end line>,<​output>​] ​ ^^^^^
-^ |Find string in a file.  |The line containing the matched string, or as specified by the optional ''​output''​ parameter ​ |**file** - full path to file\\ **regexp** - GNU regular expression\\ **encoding** - code page [[:​manual/​config/​items/​itemtypes/​zabbix_agent#​available_encodings|identifier]]\\ **start line** - the number of first line to search (first line of file by default).\\ **end line** - the number of last line to search (last line of file by default).\\ **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). ​ |Only the first matching line is returned.\\ An empty string is returned if no line matched the expression.\\ \\ Content extraction using the ''​output''​ parameter takes place on the agent.\\ \\ The ''​start line'',​ ''​end line''​ and ''​output''​ parameters are supported from version 2.2.\\ \\ Examples:\\ => 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// |+^ |Find string in a file.  |The line containing the matched string, or as specified by the optional ''​output''​ parameter ​ |**file** - full path to file\\ **regexp** - GNU regular expression\\ **encoding** - code page [[:​manual/​config/​items/​itemtypes/​zabbix_agent#​available_encodings|identifier]]\\ **start line** - the number of first line to search (first line of file by default).\\ **end line** - the number of last line to search (last line of file by default).\\ **output** - an optional output formatting template. The **\0** escape sequence is replaced with the matched ​part of text (from the first character where match begins until the character where match ends) 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). ​ |Only the first matching line is returned.\\ An empty string is returned if no line matched the expression.\\ \\ Content extraction using the ''​output''​ parameter takes place on the agent.\\ \\ The ''​start line'',​ ''​end line''​ and ''​output''​ parameters are supported from version 2.2.\\ \\ Examples:\\ => 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[file,​regexp,<​encoding>,<​start line>,<​end line>​] ​ ^^^^^ ^vfs.file.regmatch[file,​regexp,<​encoding>,<​start line>,<​end line>​] ​ ^^^^^
Line 226: Line 228:
 | ||||| | |||||
 ^web.page.regexp[host,<​path>,<​port>,​regexp,<​length>,<​output>​] ​ ^^^^^ ^web.page.regexp[host,<​path>,<​port>,​regexp,<​length>,<​output>​] ​ ^^^^^
-^ |Find string on a web page.  | The matched string, or as specified by the optional ''​output''​ parameter ​ |**host** - hostname\\ **path** - path to HTML document (default is /)\\ **port** - port number (default is 80)\\ **regexp** - GNU regular expression\\ **length** - maximum number of characters to return\\ **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). ​ |Returns an empty string if no match was found or on fail.\\ \\ Content extraction using the ''​output''​ parameter takes place on the agent.\\ \\ The ''​output''​ parameter is supported from version 2.2. \\ \\  Example:\\ => %%web.page.regexp[www.zabbix.com,​index.php,​80,​OK,​2]%% ​ |+^ |Find string on a web page.  | The matched string, or as specified by the optional ''​output''​ parameter ​ |**host** - hostname\\ **path** - path to HTML document (default is /)\\ **port** - port number (default is 80)\\ **regexp** - GNU regular expression\\ **length** - maximum number of characters to return\\ **output** - an optional output formatting template. The **\0** escape sequence is replaced with the matched ​part of text (from the first character where match begins until the character where match ends) 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). ​ |Returns an empty string if no match was found or on fail.\\ \\ Content extraction using the ''​output''​ parameter takes place on the agent.\\ \\ The ''​output''​ parameter is supported from version 2.2. \\ \\  Example:\\ => %%web.page.regexp[www.zabbix.com,​index.php,​80,​OK,​2]%% ​ |
  
-<note>A Linux-specific note. Zabbix agent must have read-only access to filesystem ///proc//. Kernel patches from www.grsecurity.org limit access rights of non-privileged users.</note>+== Footnotes == 
 + 
 +<sup>​**1**</​sup>A Linux-specific note. Zabbix agent must have read-only access to filesystem ///proc//. Kernel patches from www.grsecurity.org limit access rights of non-privileged users. 
 + 
 +<​sup>​**2**</sup''​vfs.dev.read[]'',​ ''​vfs.dev.write[]'':​ Starting with Zabbix 3.0.25 Zabbix agent will terminate %%"​%%stale%%"​%% device connections if the item values are not accessed for more than 3 hours. This may happen if a system has devices with dynamically changing paths or if a device gets manually removed. Note also that these items, if using an update interval of 3 hours or more, will always return '​0'​.  
 + 
 +<​sup>​**3**</​sup>​ ''​vfs.dev.read[]'',​ ''​vfs.dev.write[]'': ​ If default //all// is used for the first parameter then the key will return summary statistics, including all block devices like sda, sbd and their partitions (sda1, sda2, sdb3...) and multiple devices (MD raid) based on those block devices/​partitions and logical volumes (LVM) based on those block devices/​partitions. In such cases returned values should be considered only as relative value (dynamic in time) but not as absolute values. ​
  
 === Available encodings === === Available encodings ===
Line 238: Line 246:
 === Troubleshooting agent items === === Troubleshooting agent items ===
  
-  ​If used with passive agent, //Timeout// value in server configuration may need to be higher than //Timeout// in the agent configuration file. Otherwise the item may not get any value because the server request to agent timed out first.+  ​If used with the passive agent, //Timeout// value in server configuration may need to be higher than //Timeout// in the agent configuration file. Otherwise the item may not get any value because the server request to agent timed out first.