Zabbix Documentation 3.4

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

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/02/26 09:04]
martins-v proc.mem can return integer/float
manual:config:items:itemtypes:zabbix_agent [2019/08/29 12:33] (current)
martins-v fixing unquoted parameter
Line 101: Line 101:
 | ||||| | |||||
 ^proc.mem[<​name>,<​user>,<​mode>,<​cmdline>,<​memtype>​] ​ ^^^^^ ^proc.mem[<​name>,<​user>,<​mode>,<​cmdline>,<​memtype>​] ​ ^^^^^
-^ |Memory used by process in bytes. ​ |Integer - with ''​mode''​ as //max//, //min//, //sum//\\ \\ Float - with ''​mode''​ as //​avg// ​ |**name** - process name (default is //all processes//​)\\ **user** - user name (default is //all users//)\\ **mode** - possible values:\\ //avg//, //max//, //min//, //sum// (default)\\ **cmdline** - filter by command line (it is a regular expression) \\ **memtype** - [[:​manual/​appendix/​items/​proc_mem_notes|type of memory]] used by process ​ |Examples:​\\ => proc.mem[,​root] -> memory used by all processes running under the "​root"​ user\\ => proc.mem[zabbix_server,​zabbix] -> memory used by all zabbix_server processes running under the zabbix user\\ => proc.mem[,​oracle,​max,​oracleZABBIX] -> memory used by the most memory-hungry process running under oracle having oracleZABBIX in its command line\\ \\ //Note//: When several processes use shared memory, the sum of memory used by processes may result in large, unrealistic values.\\ \\ See [[manual:​appendix:​items:​proc_mem_num_notes|notes]] on selecting processes with ''​name''​ and ''​cmdline''​ parameters (Linux-specific).\\ \\ When this item is invoked from the command line and contains a command line parameter (e.g. using the agent test mode: ''​zabbix_agentd -t proc.num[,,,​apache2]''​),​ one extra process will be counted, as the agent will count itself.\\ \\ The ''​memtype''​ parameter is supported on several [[manual:​appendix:​items:​supported_by_platform|platforms]] since Zabbix 3.0.0. ​ |+^ |Memory used by process in bytes. ​ |Integer - with ''​mode''​ as //max//, //min//, //sum//\\ \\ Float - with ''​mode''​ as //​avg// ​ |**name** - process name (default is //all processes//​)\\ **user** - user name (default is //all users//)\\ **mode** - possible values:\\ //avg//, //max//, //min//, //sum// (default)\\ **cmdline** - filter by command line (it is a regular expression) \\ **memtype** - [[:​manual/​appendix/​items/​proc_mem_notes|type of memory]] used by process ​ |Examples:​\\ => proc.mem[,​root] -> memory used by all processes running under the "​root"​ user\\ => proc.mem[zabbix_server,​zabbix] -> memory used by all zabbix_server processes running under the zabbix user\\ => proc.mem[,​oracle,​max,​oracleZABBIX] -> memory used by the most memory-hungry process running under oracle having oracleZABBIX in its command line\\ \\ //Note//: When several processes use shared memory, the sum of memory used by processes may result in large, unrealistic values.\\ \\ See [[manual:​appendix:​items:​proc_mem_num_notes|notes]] on selecting processes with ''​name''​ and ''​cmdline''​ parameters (Linux-specific).\\ \\ When this item is invoked from the command line and contains a command line parameter (e.g. using the agent test mode: ''​zabbix_agentd -t proc.mem[,,,​apache2]''​),​ one extra process will be counted, as the agent will count itself.\\ \\ The ''​memtype''​ parameter is supported on several [[manual:​appendix:​items:​supported_by_platform|platforms]] since Zabbix 3.0.0. ​ |
 | ||||| | |||||
 ^proc.num[<​name>,<​user>,<​state>,<​cmdline>,<​zone>​] ​ ^^^^^ ^proc.num[<​name>,<​user>,<​state>,<​cmdline>,<​zone>​] ​ ^^^^^
Line 174: Line 174:
 | ||||| | |||||
 ^system.swap.size[<​device>,<​type>​] ​ ^^^^^ ^system.swap.size[<​device>,<​type>​] ​ ^^^^^
-^ |Swap space size in bytes or in percentage from total. ​ |Integer - for bytes\\ \\ Float - for percentage ​ |**device** - device used for swapping (default is //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) ​ |Example:\\ => system.swap.size[,​pfree] -> free swap space percentage\\ \\ If //device// is not specified Zabbix agent will only take into account swap devices (files), physical memory will be ignored. For example, on Solaris systems //swap -s// command includes a portion of physical memory and swap devices (unlike //swap -l//).\\ \\ Note that this key might report incorrect percentage on virtualized (VMware ESXi, VirtualBox) Windows platforms. In this case use perf_counter[\700(_Total)\702] key to obtain correct swap usage data.\\ \\ Old naming: //​system.swap.free//,​ //​system.swap.total// ​ |+^ |Swap space size in bytes or in percentage from total. ​ |Integer - for bytes\\ \\ Float - for percentage ​ |**device** - device used for swapping (default is //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) ​ |Example:\\ => system.swap.size[,​pfree] -> free swap space percentage\\ \\ If //device// is not specified Zabbix agent will only take into account swap devices (files), physical memory will be ignored. For example, on Solaris systems //swap -s// command includes a portion of physical memory and swap devices (unlike //swap -l//).\\ \\ Note that this key might report incorrect ​swap space size/percentage on virtualized (VMware ESXi, VirtualBox) Windows platforms. In this case you may use the ''​perf_counter[\700(_Total)\702]'' ​key to obtain correct swap space percentage.\\ \\ Old naming: //​system.swap.free//,​ //​system.swap.total// ​ |
 | ||||| | |||||
 ^system.uname ​ ^^^^^ ^system.uname ​ ^^^^^
Line 207: Line 207:
 | ||||| | |||||
 ^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** - [[https://​en.wikipedia.org/​wiki/​Perl_Compatible_Regular_Expressions|Perl Compatible Regular Expression]] (PCRE) or POSIX extended regular expression before Zabbix 3.4 \\ **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** - [[https://​en.wikipedia.org/​wiki/​Perl_Compatible_Regular_Expressions|Perl Compatible Regular Expression]] (PCRE) or POSIX extended regular expression before Zabbix 3.4 \\ **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// |
 | ||||| | |||||
 ^vfs.file.regmatch[file,​regexp,<​encoding>,<​start line>,<​end line>​] ​ ^^^^^ ^vfs.file.regmatch[file,​regexp,<​encoding>,<​start line>,<​end line>​] ​ ^^^^^
Line 231: Line 231:
 | ||||| | |||||
 ^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\\ **path** - path to HTML document (default is /)\\ **port** - port number (default is 80)  |This item turns unsupported if the resource specified in ''​host''​ does not exist or is unavailable.\\ //Note// that before version 3.4.9 it would return ​an empty string on fail.\\ \\ Example:\\ => %%web.page.get[www.zabbix.com,​index.php,​80]%% ​ |
 | ||||| | |||||
 ^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\\ **path** - path to HTML document (default is /)\\ **port** - port number (default is 80)  |This item turns unsupported if the resource specified in ''​host''​ does not exist or is unavailable.\\ //Note// that before version 3.4.9 it would return '0' ​on fail.\\ \\ Example:\\ => %%web.page.perf[www.zabbix.com,​index.php,​80]%% |
 | ||||| | |||||
 ^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** -  [[https://​en.wikipedia.org/​wiki/​Perl_Compatible_Regular_Expressions|Perl Compatible Regular Expression]] (PCRE) or POSIX extended regular expression before Zabbix 3.4\\ **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** -  [[https://​en.wikipedia.org/​wiki/​Perl_Compatible_Regular_Expressions|Perl Compatible Regular Expression]] (PCRE) or POSIX extended regular expression before Zabbix 3.4\\ **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). ​ |This item turns unsupported if the resource specified in ''​host''​ does not exist or is unavailable.\\ //Note// that before version 3.4.9 it would return ​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>​