Zabbix Documentation 4.4

2.23.04.04.2 (current)In development:4.4 (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 [2019/03/17 14:33]
dimir add link to passive checks description
manual:config:items:itemtypes:zabbix_agent [2019/06/07 06:33] (current)
martins-v
Line 50: Line 50:
 | ||||| | |||||
 ^logrt[file_regexp,<​regexp>,<​encoding>,<​maxlines>,<​mode>,<​output>,<​maxdelay>,<​options>​] ​ ^^^^^ ^logrt[file_regexp,<​regexp>,<​encoding>,<​maxlines>,<​mode>,<​output>,<​maxdelay>,<​options>​] ​ ^^^^^
-^ |Log file monitoring with log rotation support. ​ |Log  |**file_regexp** - absolute path to file and regular expression<​sup>​**[[#​footnotes|4]]**</​sup>​ describing the file name pattern\\ **regexp** - regular expression<​sup>​**[[#​footnotes|4]]**</​sup>​ 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).\\ **maxdelay** - maximum delay in seconds. Type: float. Values: 0 - (default) never ignore log file lines; > 0.0 - ignore older lines in order to get the most recent lines analyzed within "​maxdelay"​ seconds. Read the [[log_items#​using_maxdelay_parameter|maxdelay]] notes before using it!\\ **options** - type of log file rotation. Possible values:\\ //rotate// (default), //​copytruncate//​. Note that //​copytruncate//​ cannot be used together with //​maxdelay//​. In this case //​maxdelay//​ must be 0 or not specified. See [[log_items#​notes_on_handling_copytruncate_log_file_rotation|copytruncate]] notes.|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"​.%%\\ \\ //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 '​6080'​ to server. Because a numeric value is being sent, the "Type of information"​ for this item can be set to "​Numeric (unsigned)"​ and the value can be used in graphs, triggers etc.%%\\ \\ //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 regular expression<​sup>​**[[#​footnotes|4]]**</​sup>​ describing the file name pattern\\ **regexp** - regular expression<​sup>​**[[#​footnotes|4]]**</​sup>​ 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).\\ **maxdelay** - maximum delay in seconds. Type: float. Values: 0 - (default) never ignore log file lines; > 0.0 - ignore older lines in order to get the most recent lines analyzed within "​maxdelay"​ seconds. Read the [[log_items#​using_maxdelay_parameter|maxdelay]] notes before using it!\\ **options** - type of log file rotation. Possible values:\\ //rotate// (default), //​copytruncate//​. Note that //​copytruncate//​ cannot be used together with //​maxdelay//​. In this case //​maxdelay//​ must be 0 or not specified. See [[log_items#​notes_on_handling_copytruncate_log_file_rotation|copytruncate]] notes.|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.\\ \\ Note that logrt is designed to work with one currently active log file, with several other matching inactive files rotated. If, for example, a directory has many active log files, a separate logrt item should be created for each one. Otherwise if one logrt item picks up too many files it may lead to exhausted memory and a crash of monitoring.\\ \\ 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"​.%%\\ \\ //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 '​6080'​ to server. Because a numeric value is being sent, the "Type of information"​ for this item can be set to "​Numeric (unsigned)"​ and the value can be used in graphs, triggers etc.%%\\ \\ //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 ''​mode''​ parameter is supported since Zabbix 2.0.\\ The ''​output''​ parameter is supported since Zabbix 2.2.\\ The ''​maxdelay''​ parameter is supported since Zabbix 3.2.\\ The ''​options''​ parameter is supported since Zabbix 4.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 ''​mode''​ parameter is supported since Zabbix 2.0.\\ The ''​output''​ parameter is supported since Zabbix 2.2.\\ The ''​maxdelay''​ parameter is supported since Zabbix 3.2.\\ The ''​options''​ parameter is supported since Zabbix 4.0.\\ \\ See also additional information on [[log_items|log monitoring]]. ​ |
 | ||||| | |||||
Line 185: Line 185:
 ^system.users.num ​ ^^^^^ ^system.users.num ​ ^^^^^
 ^ |Number of users logged in.  |Integer ​ |  |**who** command is used on the agent side to obtain the value. ​ | ^ |Number of users logged in.  |Integer ​ |  |**who** command is used on the agent side to obtain the value. ​ |
 +| |||||
 +^vfs.dev.discovery ​ ^^^^^
 +^ |List of block devices and their type. Used for low-level discovery. ​ |JSON object ​ |  |This item is supported on Linux platform only.\\ \\ Supported since Zabbix 4.4.0. ​ |
 | ||||| | |||||
 ^vfs.dev.read[<​device>,<​type>,<​mode>​] ​ ^^^^^ ^vfs.dev.read[<​device>,<​type>,<​mode>​] ​ ^^^^^
Line 235: Line 238:
 | ||||| | |||||
 ^web.page.get[host,<​path>,<​port>​] ​ ^^^^^ ^web.page.get[host,<​path>,<​port>​] ​ ^^^^^
-^ |Get content of web page.  |Web page source as text (including headers) ​ |**host** - hostname\\ **path** - path to HTML document (default is /)\\ **port** - port number (default is 80)  |Returns an empty string on fail. \\ \\ Example:\\ => %%web.page.get[www.zabbix.com,​index.php,​80]%% ​ |+^ |Get content of web page.  |Web page source as text (including headers) ​ |**host** - hostname ​or URL (as ''​%%scheme://​host:​port/​path%%'',​ where only //host// is mandatory).\\ Allowed URL schemes: //http//, //​https//<​sup>​**[[#​footnotes|5]]**</​sup>​. Missing scheme will be treated as //http//. If URL is specified ''​path''​ and ''​port''​ must be empty. Specifying user name/​password when connecting to servers that require authentication,​ for example: ''​%%http://​user:​[email protected]%%''​ is only possible with cURL support <​sup>​**[[#​footnotes|5]]**</​sup>​.\\ Punycode is suported in hostnames.\\ **path** - path to HTML document (default is /)\\ **port** - port number (default is 80 for HTTP)  |Returns an empty string on fail.\\ \\ ''​host''​ can be hostname, domain name, IPv4 or IPv6 address. But for IPv6 address Zabbix agent must be compiled with IPv6 support enabled.\\ \\ Example:\\ => %%web.page.get[www.zabbix.com,​index.php,​80]%%\\  => %%web.page.get[https://​www.zabbix.com]%%\\ => %%web.page.get[https://​blog.zabbix.com/?​s=zabbix]%%\\ ​ => %%web.page.get[localhost:​80]%%\\ => %%web.page.get["​[::​1]/​server-status"​]%%  |
 | ||||| | |||||
 ^web.page.perf[host,<​path>,<​port>​] ​ ^^^^^ ^web.page.perf[host,<​path>,<​port>​] ​ ^^^^^
-^ |Loading time of full web page (in seconds). ​ |Float ​ |**host** - hostname\\ **path** - path to HTML document (default is /)\\ **port** - port number (default is 80)  |Returns 0 on fail. \\ \\ Example:\\ => %%web.page.perf[www.zabbix.com,​index.php,​80]%% |+^ |Loading time of full web page (in seconds). ​ |Float ​ |**host** - hostname ​or URL (as ''​%%scheme://​host:​port/​path%%'',​ where only //host// is mandatory).\\ Allowed URL schemes: //http//, //​https//<​sup>​**[[#​footnotes|5]]**</​sup>​. Missing scheme will be treated as //http//. If URL is specified ''​path''​ and ''​port''​ must be empty. Specifying user name/​password when connecting to servers that require authentication,​ for example: ''​%%http://​user:​[email protected]%%''​ is only possible with cURL support <​sup>​**[[#​footnotes|5]]**</​sup>​.\\ Punycode is suported in hostnames.\\ **path** - path to HTML document (default is /)\\ **port** - port number (default is 80 for HTTP)  |Returns 0 on fail.\\ \\ ''​host''​ can be hostname, domain name, IPv4 or IPv6 address. But for IPv6 address Zabbix agent must be compiled with IPv6 support enabled.\\ \\ Example:\\ => %%web.page.perf[www.zabbix.com,​index.php,​80]%%\\  => %%web.page.perf[https://​www.zabbix.com]%%  ​|
 | ||||| | |||||
 ^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** - regular expression<​sup>​**[[#​footnotes|4]]**</​sup>​ describing the required pattern\\ **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]%% ​ |+^ |Find string on a web page.  | The matched string, or as specified by the optional ''​output''​ parameter ​ |**host** - hostname ​or URL (as ''​%%scheme://​host:​port/​path%%'',​ where only //host// is mandatory).\\ Allowed URL schemes: //http//, //​https//<​sup>​**[[#​footnotes|5]]**</​sup>​. Missing scheme will be treated as //http//. If URL is specified ''​path''​ and ''​port''​ must be empty. Specifying user name/​password when connecting to servers that require authentication,​ for example: ''​%%http://​user:​[email protected]%%''​ is only possible with cURL support <​sup>​**[[#​footnotes|5]]**</​sup>​.\\ Punycode is suported in hostnames.\\ **path** - path to HTML document (default is /)\\ **port** - port number (default is 80 for HTTP)\\ **regexp** - regular expression<​sup>​**[[#​footnotes|4]]**</​sup>​ describing the required pattern\\ **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.\\ \\ ''​host''​ can be hostname, domain name, IPv4 or IPv6 address. But for IPv6 address Zabbix agent must be compiled with IPv6 support enabled.\\ \\ 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]%%\\ ​ => %%web.page.regexp[https://​www.zabbix.com,,​,​OK,​2]%% ​ |
 ^zabbix.stats[<​ip>,<​port>​] ​ ^^^^^ ^zabbix.stats[<​ip>,<​port>​] ​ ^^^^^
 ^ |Return a set of Zabbix server or proxy internal metrics remotely. ​ |JSON object ​ |**ip** - IP/​DNS/​network mask list of servers/​proxies to be remotely queried (default is 127.0.0.1)\\ **port** - port of server/​proxy to be remotely queried (default is 10051) ​ |Note that the stats request will only be accepted from the addresses listed in the '​StatsAllowedIP'​ [[:​manual/​appendix/​config/​zabbix_server|server]]/​[[:​manual/​appendix/​config/​zabbix_proxy|proxy]] parameter on the target instance.\\ \\ A selected set of internal metrics is returned by this item. For details, see [[:​manual/​appendix/​items/​remote_stats#​exposed_metrics|Remote monitoring of Zabbix stats]]. ​ | ^ |Return a set of Zabbix server or proxy internal metrics remotely. ​ |JSON object ​ |**ip** - IP/​DNS/​network mask list of servers/​proxies to be remotely queried (default is 127.0.0.1)\\ **port** - port of server/​proxy to be remotely queried (default is 10051) ​ |Note that the stats request will only be accepted from the addresses listed in the '​StatsAllowedIP'​ [[:​manual/​appendix/​config/​zabbix_server|server]]/​[[:​manual/​appendix/​config/​zabbix_proxy|proxy]] parameter on the target instance.\\ \\ A selected set of internal metrics is returned by this item. For details, see [[:​manual/​appendix/​items/​remote_stats#​exposed_metrics|Remote monitoring of Zabbix stats]]. ​ |
Line 257: Line 260:
  
 <​sup>​**4**</​sup>​ [[https://​en.wikipedia.org/​wiki/​Perl_Compatible_Regular_Expressions|Perl Compatible Regular Expression]] (PCRE) since Zabbix 3.4; POSIX-extended regular expression before that. See also: [[:​manual/​regular_expressions#​regular_expression_support_by_location|Regular expressions supported by location]]. <​sup>​**4**</​sup>​ [[https://​en.wikipedia.org/​wiki/​Perl_Compatible_Regular_Expressions|Perl Compatible Regular Expression]] (PCRE) since Zabbix 3.4; POSIX-extended regular expression before that. See also: [[:​manual/​regular_expressions#​regular_expression_support_by_location|Regular expressions supported by location]].
 +
 +<​sup>​**5**</​sup>​ SSL (HTTPS) is supported only if agent is compiled with cURL support. Otherwise the item will turn unsupported.
  
 === Available encodings === === Available encodings ===