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 [2018/12/06 13:47] (current)
martins-v more precise wording
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 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>​ <​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>​