PDA

View Full Version : Web monitoring: Underscore (_) makes the regular expression always fail. Or does it?


Speque
02-07-2010, 14:13
Hello everyone.

I have a very mysterious problem with Zabbix web monitoring and using regular expressions to check fetched content.

I have a web check scenario with one step and that step includes fetching an HTML-page and checking for its contents. The only that the fetched file contains is the text

HTML_JSP

and nothing else. I then try to match it with a regular expression pattern

^HTML_JSP$

but the test always fails. If I change the test to for example

^HTML

it works fine, but for example these do not:

^HTML_ , ^HTML_JSP , ^HTML.JSP , HTML_JSP , JSP$

On the other hand I have similar test with files containing

OK

and patterns

^OK$

and they work fine.

It seems that the underscore is the source of the problems, but how can it be??? Unfortunately I have to check for that exact string and I cannot change that.

Anyone having an idea what is going on? Or if someone of you has some web checks working, could you try if that underscore really is the problem, or if I'm just having some weird personal penalty.

With kind regards

Pekka

a new and confused Zabbix user

Speque
05-07-2010, 08:34
Oh, I completely forgot: the version I'm using is 1.4.6. (from Debian repository).