Xymon Mailing List Archive search

client-local.cfg pattern matching

2 messages in this thread

list Schminke_Erik_D · Wed, 30 Nov 2016 12:41:53 -0600 ·
I think there is a problem with how xymon processes the client-local.cfg
file when it comes to pattern matching.

I have the following in my client-local.cfg:
[host=%(elm|oak|oracle[0-9][dp])]

Next time this file is checked, this shows up in the xymond.log:
2016-11-30 11:06:50.100740 pcre compile '(elm|oak|oracle[0-9' failed
(offset 19): missing terminating ] for character class
2016-11-30 11:06:50.100829 Invalid host pattern in client-local.cfg: (elm|
oak|oracle[0-9

It seems like whatever engine processes the client-local.cfg is doing a
lazy pattern matching.  Rather than taking everything up to the LAST
closing bracket, it grabs up to the FIRST closing bracket.

However this is designed to work, grabbing up to the first closing bracket
seriously breaks PCRE matching.  I think a change to this process is in
order so that it grabs the LAST closing bracket.  Especially, if a % is
present, indicating the following is PCRE pattern.

Thanks,


Erik D. Schminke | Associate Systems Programmer
Hormel Foods Corporation | One Hormel Place | Austin, MN XXXXX
Phone: (XXX) XXX-XXXX
user-15513f33c451@xymon.invalid | www.hormelfoods.com
list Japheth Cleaver · Wed, 30 Nov 2016 12:36:42 -0800 ·
quoted from Schminke_Erik_D
On 11/30/2016 10:41 AM, user-15513f33c451@xymon.invalid wrote:
I think there is a problem with how xymon processes the client-local.cfg
file when it comes to pattern matching.

I have the following in my client-local.cfg:
[host=%(elm|oak|oracle[0-9][dp])]

Next time this file is checked, this shows up in the xymond.log:
2016-11-30 11:06:50.100740 pcre compile '(elm|oak|oracle[0-9' failed
(offset 19): missing terminating ] for character class
2016-11-30 11:06:50.100829 Invalid host pattern in client-local.cfg: (elm|
oak|oracle[0-9

It seems like whatever engine processes the client-local.cfg is doing a
lazy pattern matching.  Rather than taking everything up to the LAST
closing bracket, it grabs up to the FIRST closing bracket.

However this is designed to work, grabbing up to the first closing bracket
seriously breaks PCRE matching.  I think a change to this process is in
order so that it grabs the LAST closing bracket.  Especially, if a % is
present, indicating the following is PCRE pattern.
Thanks, I can confirm this is a bug.

The attached patch I believe should resolve it for you.
It's applied in 4.3.28 at https://sourceforge.net/p/xymon/code/7985/ and 
will be in the next release.

Regards,
-jc