Implementing vfs.file.regexp checks to look for data inside a file (capture for inventory and validation). Following the instructions from the manual I created the entry per the guidelines: vfs.file.regexp[file,regexp,<encoding>,<start line>,<end line>,<output>]
I get the whole output, awesome right! nope... then I add the output option to juts get the 7.1 it does not work...
\0 zero works! shows me the item matched.
Nothing for \1-\9...
If I make the regex any more complicated I am greeted with an "Invalid key format" even if just adding ranges of numbers/characters...
Any ideas on what I am doing wrong? Why wont the output work and why does any expanded options in the regexp yield the invalid format, I have tested in regexp and it works outside of zabbix.
Code:
$ /usr/sbin/zabbix_agentd -t "vfs.file.regexp[/etc/opt/app/ENV,"^VERSION",,,,]" vfs.file.regexp[/etc/opt/app/ENV,^VERSION,,,,] [s|VERSION=7.1]
I get the whole output, awesome right! nope... then I add the output option to juts get the 7.1 it does not work...
Code:
$ /usr/sbin/zabbix_agentd -t "vfs.file.regexp[/etc/opt/app/ENV,"^VERSION",,,,\0]" vfs.file.regexp[/etc/opt/app/ENV,^VERSION,,,,\0] [s|VERSION]
\0 zero works! shows me the item matched.
Code:
$ /usr/sbin/zabbix_agentd -t "vfs.file.regexp[/etc/opt/app/ENV,"^VERSION",,,,\1]" vfs.file.regexp[/etc/opt/app/ENV,^VERSION,,,,\1] [s|]
Nothing for \1-\9...
If I make the regex any more complicated I am greeted with an "Invalid key format" even if just adding ranges of numbers/characters...
Code:
$ /usr/sbin/zabbix_agentd -t "vfs.file.regexp[/etc/opt/app/ENV,"VERSION=[0-9].[0-9]",,,,]" vfs.file.regexp[/etc/opt/app/ENV,VERSION[0-9],,,,] [m|ZBX_NOTSUPPORTED] [Invalid item key format.]
Any ideas on what I am doing wrong? Why wont the output work and why does any expanded options in the regexp yield the invalid format, I have tested in regexp and it works outside of zabbix.
Code:
$ cat /etc/opt/app/ENV | grep '^VERSION=[0-9].[0-9]' VERSION=7.1
Comment