Hi everyone,
I have a hopefully a small issue. I have created a item to read the log file from robocopy and extract the error code
"vfs.file.regexp[/pathtolog/TEMP.log,(\bFEHLER 2\b|\bFEHLER 3\b|\bFEHLER 5\b|\bFEHLER 32\b|\bFEHLER 53\b|\bFEHLER 64\b|\bFEHLER 112\b|\bFEHLER 121\b),,,].
which returns the string
"2021/06/02 14:26:05 FEHLER 2 (0x00000002) Zugriff auf Quellverzeichnis C:\tmp" which is fine.
Then I created a trigger with the expression
{Zabbix server:vfs.file.regexp[/pathtolog/TEMP.log,(\bFEHLER 2\b|\bFEHLER 3\b|\bFEHLER 5\b|\bFEHLER 32\b|\bFEHLER 53\b|\bFEHLER 64\b|\bFEHLER 112\b|\bFEHLER 121\b),,,].str()}=1
which is working as well buuuuuuttt as soon as the created item returns "<empty string>" the trigger is still running.
So I created a recovery expression
{Zabbix server:vfs.file.regexp[/pathtolog/TEMP.log,(\bFEHLER 2\b|\bFEHLER 3\b|\bFEHLER 5\b|\bFEHLER 32\b|\bFEHLER 53\b|\bFEHLER 64\b|\bFEHLER 112\b|\bFEHLER 121\b),,,].str()}=0 but
nothing changed
.
I have tried it with "strlen" the same issue.
Can some one help me to solve the issue? or has a hint what is going wrong with the recovery expression or does it even work with a string?
Thnak you very much.
Regards
NotaGain
We are using Zabbix 5.0.7
I have a hopefully a small issue. I have created a item to read the log file from robocopy and extract the error code
"vfs.file.regexp[/pathtolog/TEMP.log,(\bFEHLER 2\b|\bFEHLER 3\b|\bFEHLER 5\b|\bFEHLER 32\b|\bFEHLER 53\b|\bFEHLER 64\b|\bFEHLER 112\b|\bFEHLER 121\b),,,].
which returns the string
"2021/06/02 14:26:05 FEHLER 2 (0x00000002) Zugriff auf Quellverzeichnis C:\tmp" which is fine.
Then I created a trigger with the expression
{Zabbix server:vfs.file.regexp[/pathtolog/TEMP.log,(\bFEHLER 2\b|\bFEHLER 3\b|\bFEHLER 5\b|\bFEHLER 32\b|\bFEHLER 53\b|\bFEHLER 64\b|\bFEHLER 112\b|\bFEHLER 121\b),,,].str()}=1
which is working as well buuuuuuttt as soon as the created item returns "<empty string>" the trigger is still running.

So I created a recovery expression
{Zabbix server:vfs.file.regexp[/pathtolog/TEMP.log,(\bFEHLER 2\b|\bFEHLER 3\b|\bFEHLER 5\b|\bFEHLER 32\b|\bFEHLER 53\b|\bFEHLER 64\b|\bFEHLER 112\b|\bFEHLER 121\b),,,].str()}=0 but
nothing changed
.I have tried it with "strlen" the same issue.
Can some one help me to solve the issue? or has a hint what is going wrong with the recovery expression or does it even work with a string?

Thnak you very much.
Regards
NotaGain
We are using Zabbix 5.0.7
the active and the passive agent. I also reworked the regex into (FEHLER|ERROR)\d+ so that it is not that long and a various error or Fehler code can be read by the item.
Comment