[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [hobbit] hobbit-alerts.cfg -- Perl regex



On Thu, Aug 11, 2005 at 03:07:47PM -0300, Werner Michels (Ext Lists) wrote:
> Robert,
> 
> 	Please try change the HG definition as:
> 
> $HG-WinSvrsCrit=%nyc(app1|dc1|dc2|ex1|ex03|fs1|fs2|time).domain.com
> 
> 	Observe that the "%" is the first char and this indicates that your using perl regex.
> 	With this change your host group should work fine. 

Werner is right here - the "%" must be first, it's only mission is to
tell Hobbit to treat this as a regular expression instead of a simple
text string.

For debugging regular expressions, I routinely use the info-page
display (which shows clearly whether a host/test is matched or not),
but also the "pcretest" tool that comes with the pcre library. Like
this:

$ pcretest
PCRE version 4.5 01-December-2003

  re> /nyc(app1|dc1|dc2|ex1|ex03|fs1|fs2|time).domain.com/
  data> nycdc2.domain.com
    0: nycdc2.domain.com
    1: dc2
  data> nycdc4.domain.com
    No match


Regards,
Henrik