PCRE regular expressions (help?)
list Tom Kauffman
I thought I knew what I was doing, but apparently not: PCRE compile of NORRDDISKS='^/oracle/PRD/sapdata.*' failed I'm trying to use the patch Henrik so kindly provided earlier. And what I really want to suppress (shell syntax) is: /oracle/*/sapdata* /oracle/*/data? /oracle/*/mirr* /oracle/*/orig* Here's the generic I tried: PCRE compile of NORRDDISKS='^/oracle/.../sapdata.*| ^/oracle/.../mirr.*| ^/oracle/.../orig.*| ^/oracle/.../data.*' failed What am I missing? TIA Tom -----Original Message----- From: Uwe Kirbach [mailto:user-61d67660b72e@xymon.invalid] Sent: Sunday, May 01, 2005 2:27 PM To: user-ae9b8668bcde@xymon.invalid Subject: Re: [hobbit] bb-sar - was: CPU info Am Samstag, den 30.04.2005, 15:19 -0400 schrieb John Turner:
On Apr 30, 2005, at 11:41 AM, Henrik Stoerner wrote: We use the bb-sar extension from www.deadcat.net on many of our hosts.
I haven't tried to get it working with Hobbit yet, but it does CPU utilization in percentages. John
Hello John, how did you got bb-sar running ? I tried it, but the sar-page of a host had only dead links. Do you hae a little howto or a tip ? Would be interested to get it running inside hobbit. If you want too, we could try it together. Uwe Kirbach
list Daniel J McDonald
▸
On Mon, 2005-05-02 at 12:47 -0500, Kauffman, Tom wrote:
I thought I knew what I was doing, but apparently not: PCRE compile of NORRDDISKS='^/oracle/PRD/sapdata.*' failed I'm trying to use the patch Henrik so kindly provided earlier. And what I really want to suppress (shell syntax) is: /oracle/*/sapdata* /oracle/*/data? /oracle/*/mirr* /oracle/*/orig* Here's the generic I tried: PCRE compile of NORRDDISKS='^/oracle/.../sapdata.*| ^/oracle/.../mirr.*| ^/oracle/.../orig.*| ^/oracle/.../data.*' failed
Got to escape the slashes... NORRDISKs="^\/oracle\/.+?\/(sapdata|mirr|data|orig)' Which reads: begins with /oracle/, followed by as few letters as possible before another slash, then a string starting with sapdata, mirr, data, or orig -- Daniel J McDonald, CCIE # 2495, CNX Austin Energy user-290ce4e24e19@xymon.invalid
list Tom Kauffman
I thought about the escapes -- but PCRE doesn't seem to like this any better: PCRE compile of NORRDDISKS='^\/oracle\/.+?\/(sapdata|data|orig|mirr)' failed (and the original needs to have a double \\ in each spot, to escape the escape, for the shell export). Thanks Tom
▸
-----Original Message-----
From: Daniel J McDonald [mailto:user-290ce4e24e19@xymon.invalid]
Sent: Monday, May 02, 2005 1:30 PM
To: Hobbit List
Subject: Re: [hobbit] PCRE regular expressions (help?)
On Mon, 2005-05-02 at 12:47 -0500, Kauffman, Tom wrote:I thought I knew what I was doing, but apparently not: PCRE compile of NORRDDISKS='^/oracle/PRD/sapdata.*' failed I'm trying to use the patch Henrik so kindly provided earlier. And what I really want to suppress (shell syntax) is: /oracle/*/sapdata* /oracle/*/data? /oracle/*/mirr* /oracle/*/orig* Here's the generic I tried: PCRE compile of NORRDDISKS='^/oracle/.../sapdata.*|
^/oracle/.../mirr.*|
^/oracle/.../orig.*| ^/oracle/.../data.*' failed
Got to escape the slashes... NORRDISKs="^\/oracle\/.+?\/(sapdata|mirr|data|orig)' Which reads: begins with /oracle/, followed by as few letters as possible before another slash, then a string starting with sapdata, mirr, data, or orig -- Daniel J McDonald, CCIE # 2495, CNX Austin Energy user-290ce4e24e19@xymon.invalid
list Henrik Størner
▸
On Mon, May 02, 2005 at 12:47:15PM -0500, Kauffman, Tom wrote:
I thought I knew what I was doing, but apparently not: PCRE compile of NORRDDISKS='^/oracle/PRD/sapdata.*' failed I'm trying to use the patch Henrik so kindly provided earlier.
Hmm - it's not my lucky day for doing patches, sorry.
There's a clear cut'n'paste bug in the patch I sent out:
Line 39 of hobbitd/larrd/do_disk.c reads:
if (!inclpattern) errprintf("PCRE compile of NORRDDISKS ....
It was meant to test the *exclude* pattern there, so it should be
if (!exclpattern) errprintf("PCRE compile of NORRDDISKS ....
This means you'll get that error-message no matter what you put into
the NORRDDISKS variable.
▸
And what I really want to suppress (shell syntax) is: /oracle/*/sapdata* /oracle/*/data? /oracle/*/mirr* /oracle/*/orig* Here's the generic I tried:
PCRE compile of NORRDDISKS='^/oracle/.../sapdata.*|^/oracle/.../mirr.*|^/oracle/.../orig.*|^/oracle/.../data.*' failedI tested it with this one: NORRDDISKS="^/oracle/[a-z,0-9]+/sapdata.*|^/oracle/[a-z,0-9]+/mirr.*|^/oracle/[a-z,0-9]+/orig.*|^/oracle/[a-z,0-9]+/data.*" Feeding it some hand-crafted disk status messages it seems to work OK. Note that hobbitserver.cfg is processed by a C program, not a shell tool. So you shouldn't need to escape any of the special characters. Henrik
list Tom Kauffman
That fixes it! Tom
▸
-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid]
Sent: Monday, May 02, 2005 3:53 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] PCRE regular expressions (help?)
On Mon, May 02, 2005 at 12:47:15PM -0500, Kauffman, Tom wrote:I thought I knew what I was doing, but apparently not: PCRE compile of NORRDDISKS='^/oracle/PRD/sapdata.*' failed I'm trying to use the patch Henrik so kindly provided earlier.
Hmm - it's not my lucky day for doing patches, sorry.
There's a clear cut'n'paste bug in the patch I sent out:
Line 39 of hobbitd/larrd/do_disk.c reads:
if (!inclpattern) errprintf("PCRE compile of NORRDDISKS ....
It was meant to test the *exclude* pattern there, so it should be
if (!exclpattern) errprintf("PCRE compile of NORRDDISKS ....
This means you'll get that error-message no matter what you put into
the NORRDDISKS variable.
And what I really want to suppress (shell syntax) is: /oracle/*/sapdata* /oracle/*/data? /oracle/*/mirr* /oracle/*/orig* Here's the generic I tried: PCRE compile of
NORRDDISKS='^/oracle/.../sapdata.*|^/oracle/.../mirr.*|^/oracle/.../orig .*|^/oracle/.../data.*' failed I tested it with this one: NORRDDISKS="^/oracle/[a-z,0-9]+/sapdata.*|^/oracle/[a-z,0-9]+/mirr.*|^/o racle/[a-z,0-9]+/orig.*|^/oracle/[a-z,0-9]+/data.*"
▸
Feeding it some hand-crafted disk status messages it seems to work OK.
Note that hobbitserver.cfg is processed by a C program, not a shell
tool. So you shouldn't need to escape any of the special characters.
Henrik