Hi all,
I'm fighting with str and regexp function to use them with 'complex' parameters. By complex, I mean 'composed by more than one word' (a-z, A-Z, 0-9)...
In fact, following the Monitoring Log files tutorial (zabbix website), monitoring of log files works like a charm: any new entri is 'captured and sendback' to zabbix_server. Cool.
Using a simple trigger, based ont str() or regexp() functions (RTFM), event triggering base on a simple world, say 'error', like in the following trigger expression, works like a charm too:
Using regexp with the same parameter ('error'), like in the following trigger expression give the same good result:
Well, fine, may works for lots of jobs, but... I now need to check for more complex expression on my logfiles: not only one world, but a complete string, like, for example "my name is Bond". Using the php frontend, I cannot use str() nor regexp() with this string: frontend complaining:
So I decided to:
Just to see if it could works... and... it just seems to work: trigger expression is updated (you can check in the trigger list for the host), and is correctly evaluated by zabbix_server as the trigger is going ON/OFF if some James is announcing itself in the logfile...
So, I suspect a bug in the php frontend with str() and regexp() manipulation in the trigger edition form. I tried to have a look, but I'm not a php-litterate boy, so... Can somebody more experimented than I can check for this bug?
I'm fighting with str and regexp function to use them with 'complex' parameters. By complex, I mean 'composed by more than one word' (a-z, A-Z, 0-9)...
In fact, following the Monitoring Log files tutorial (zabbix website), monitoring of log files works like a charm: any new entri is 'captured and sendback' to zabbix_server. Cool.
Using a simple trigger, based ont str() or regexp() functions (RTFM), event triggering base on a simple world, say 'error', like in the following trigger expression, works like a charm too:
Code:
{host:log[/my/logfile].str(error)}>0
Code:
{host:log[/my/logfile].regexp(error)}>0
Code:
Expression [{host:log[/my/logfile].regexp(my name is Bond)}] does not match to [server:key.func(param)]
So I decided to:
- let's rock with a single world (regexp(my)),
- SQL update 'by hand' the parameter value (update functions set parameter="my name is Bond" where functionid="XXXX")
Just to see if it could works... and... it just seems to work: trigger expression is updated (you can check in the trigger list for the host), and is correctly evaluated by zabbix_server as the trigger is going ON/OFF if some James is announcing itself in the logfile...
So, I suspect a bug in the php frontend with str() and regexp() manipulation in the trigger edition form. I tried to have a look, but I'm not a php-litterate boy, so... Can somebody more experimented than I can check for this bug?
Comment