[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] Reg Exp matching in hobbit-clients.cfg
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] Reg Exp matching in hobbit-clients.cfg
- From: henrik (at) hswn.dk (Henrik Stoerner)
- Date: Wed, 29 Aug 2007 17:36:41 +0200
- References: <cc9330a50708290819r31267474u1e1afaab8227ebdf (at) mail.gmail.com>
- User-agent: Mutt/1.5.13 (2006-08-11)
On Wed, Aug 29, 2007 at 11:19:17AM -0400, Bill Matthews wrote:
> Greetings,
>
> I've been able to do some basic regular expression matching using the
> examples in hobbit-clients.cfg.
>
> For example, this works fine:
> HOST=%(server1|server2|server3).domain.com
>
> But this doesn't:
> HOST=%(server*).domain.com
>
> I'm sure I'm just missing the syntax for wildcard matching?
Yep, this one is a classic: "*" means "zero or more occurrences of the
previous letter", so when you write "server*", it means "0 or more
occurrences of letter 'r'". I.e. it matches "serve", "server", "serverr"
and so on.
You should use the "." wildcard character. Like
HOST=%(server.*).domain.com
> Also is there a way to define a test for every server except some hosts? I
> have a lot of tests I would love to put in the DEFAULT section, but I have a
> couple hosts that the tests would fail for.
Use the EXHOST setting, just like "HOST" but it excludes hosts - this
can be used with or without a HOST setting. E.g.
EXHOST=%badhost.*\.domain\.com
PROC cron
is a valid way of checking that "cron" is running on all hosts, except
those called "badhost<something>"
Regards,
Henrik