Xymon Mailing List Archive search

hobbit-alerts.cfg -- Perl regex

list Robert Herron
Thu, 11 Aug 2005 16:51:57 -0400
Message-Id: <user-6f2eb26ea30d@xymon.invalid>

Moving the % fixed the problem.  Thanks for the help and tip.

On 11 Aug 2005 20:45:26 -0000, user-ce4a2c883f75@xymon.invalid (Henrik Stoerner) wrote: 
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

-- 


Robert Herron
user-8b27ea4290da@xymon.invalid