Zabbix Documentation 3.2

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
manual:config:items:itemtypes:zabbix_agent [2019/07/05 11:43]
martins-v more precise wording
manual:config:items:itemtypes:zabbix_agent [2019/08/29 12:44] (current)
martins-v fixing unquoted parameter
Line 200: Line 200:
 | ||||| | |||||
 ^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 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>​] ​ ^^^^^