[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
hobbit-alerts.cfg -- Perl regex
- To: hobbit (at) hswn.dk
- Subject: hobbit-alerts.cfg -- Perl regex
- From: Robert Herron <robert.herron (at) gmail.com>
- Date: Thu, 11 Aug 2005 13:07:05 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=IthRRTUa68LA3eWDzV4hijveQVovnc3L+3Ud0qdCkuVyMelK58Hu1NLLTtd5QzJjv4tH5TYHtQfvwbK7YVbbkFt52iTQa7p/22RPuHSArBxX90dSd3hGOcRjDnv7BtNpJphuqT1V21nrJ9T29PblasK//5bck8M1b/1SWUzFQiE=
I'm having a problem with Perl regular expressions in the
hobbit-alerts.cfg file. Can someone tell me what I'm doing wrong:
Background info: our servers are named by location, function, number
(e.g. NYCMAIL1). As our data center in "NYC", a lot of systems's
names start with NYC.
I'm lazy and really don't want to have to type NYC over and over
again. So, I tried using a macro with a wildcard like:
$HG-WinSvrsCrit=nyc%(app1|dc1|dc2|ex1|ex03|fs1|fs2|time).domain.com
but it doesn't work. However, it works if I change it to:
$HG-WinSvrsCrit=%(nycapp1|nycdc1|nycdc2|nycex1|nycex03|nycfs1|nycfs2|nyctime).domain.com
The $HG-WinSvrsCrit wildcard is used later in hobbit-alerts.cfg with
statements like:
HOST=$HG-WinSvrsCrit $OPTIONS EXSERVICE=smtp,oradb
MAIL bb_NetAdm
MAIL bb_SrPCT
MAIL bb_ProjMgr DURATION>60m
A "~/server/bin/hobbitd_alert --dump_config" looks correct for the
desired macro/wildcard combo:
HOST=nyc%(app1|dc1|dc2|ex1|ex03|fs1|fs2|gis2|time).domain.com
EXSERVICE=smtp,oradb COLOR=purple,red
MAIL bb_NetAdm FORMAT=TEXT REPEAT=30
MAIL bb_SrPCT FORMAT=TEXT REPEAT=30
MAIL bb_ProjMgr FORMAT=TEXT REPEAT=30 DURATION>60
But the INFO page for the nyc[app1|dc1|dc2|ex1|ex03|fs1|fs2|gis2|time]
hosts only shows UNMATCHED catch-all entry.
I'm stumped. Please help.
--
Robert Herron
robert.herron (at) gmail.com