Reg Exp matching in hobbit-clients.cfg
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?
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.
I'm wondering if something like this would be possible? HOST=%(!badhost1|badhost2).domain.com
Thanks for the help, BM
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
Thanks Henrik, both of those worked perfectly. I'm in business!
Regards, BM
Bill,
I have used this with success.
HOST=%(atlftp|atlldap1|atlldap2|atlldap3|atllog|atlmidware1|atlmidware2| atlnfs1|atlnfs2|atlnfs3|atlsip1|atlsip2|atlsipc1|atlsipnot1|atlsipc2|atl sipnot2|atlsipreg2|atltma1|atltma2|atlvdns1|atlvdns2|atlvmail1|atlvsp2|a tlvsp3|atlsniffer1|atlsniffer2|atlmidware1|atlnfs1|atlsipreg1|atlvweb1|a tlvweb2|atlvweb3|atlmidware1|atlnfs1|atlsipreg1|atlvmailrelay|atlvweb1|a tlvweb2|atlvoipdb0).intelliverse.com
Ken Cooper
From: Bill Matthews [mailto:bill.matthews at gmail.com] Sent: Wednesday, August 29, 2007 11:19 AM To: hobbit at hswn.dk Subject: [hobbit] Reg Exp matching in hobbit-clients.cfg
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?
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.
I'm wondering if something like this would be possible? HOST=%(!badhost1|badhost2).domain.com
Thanks for the help, BM
Wow...not knowing anything about your environment, it seems like it would've been easier to do an EXHOST...or HOST=%(atl.*)\.intelliverse\.com
=G=
From: Cooper, Ken [mailto:Ken.Cooper at Intelliverse.com] Sent: Wednesday, August 29, 2007 11:39 AM To: hobbit at hswn.dk Subject: RE: [hobbit] Reg Exp matching in hobbit-clients.cfg
Bill,
I have used this with success.
HOST=%(atlftp|atlldap1|atlldap2|atlldap3|atllog|atlmidware1|atlmidware2| atlnfs1|atlnfs2|atlnfs3|atlsip1|atlsip2|atlsipc1|atlsipnot1|atlsipc2|atl sipnot2|atlsipreg2|atltma1|atltma2|atlvdns1|atlvdns2|atlvmail1|atlvsp2|a tlvsp3|atlsniffer1|atlsniffer2|atlmidware1|atlnfs1|atlsipreg1|atlvweb1|a tlvweb2|atlvweb3|atlmidware1|atlnfs1|atlsipreg1|atlvmailrelay|atlvweb1|a tlvweb2|atlvoipdb0).intelliverse.com
Ken Cooper
From: Bill Matthews [mailto:bill.matthews at gmail.com] Sent: Wednesday, August 29, 2007 11:19 AM To: hobbit at hswn.dk Subject: [hobbit] Reg Exp matching in hobbit-clients.cfg
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?
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.
I'm wondering if something like this would be possible? HOST=%(!badhost1|badhost2).domain.com
Thanks for the help, BM
It was actually an IGNORE HOST, we used it to turn on and off monitoring of a complete datacenter.
From: Galen Johnson [mailto:Galen.Johnson at sas.com] Sent: Wednesday, August 29, 2007 12:31 PM To: hobbit at hswn.dk Subject: RE: [hobbit] Reg Exp matching in hobbit-clients.cfg
Wow...not knowing anything about your environment, it seems like it would've been easier to do an EXHOST...or HOST=%(atl.*)\.intelliverse\.com
=G=
From: Cooper, Ken [mailto:Ken.Cooper at Intelliverse.com] Sent: Wednesday, August 29, 2007 11:39 AM To: hobbit at hswn.dk Subject: RE: [hobbit] Reg Exp matching in hobbit-clients.cfg
Bill,
I have used this with success.
HOST=%(atlftp|atlldap1|atlldap2|atlldap3|atllog|atlmidware1|atlmidware2| atlnfs1|atlnfs2|atlnfs3|atlsip1|atlsip2|atlsipc1|atlsipnot1|atlsipc2|atl sipnot2|atlsipreg2|atltma1|atltma2|atlvdns1|atlvdns2|atlvmail1|atlvsp2|a tlvsp3|atlsniffer1|atlsniffer2|atlmidware1|atlnfs1|atlsipreg1|atlvweb1|a tlvweb2|atlvweb3|atlmidware1|atlnfs1|atlsipreg1|atlvmailrelay|atlvweb1|a tlvweb2|atlvoipdb0).intelliverse.com
Ken Cooper
From: Bill Matthews [mailto:bill.matthews at gmail.com] Sent: Wednesday, August 29, 2007 11:19 AM To: hobbit at hswn.dk Subject: [hobbit] Reg Exp matching in hobbit-clients.cfg
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?
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.
I'm wondering if something like this would be possible? HOST=%(!badhost1|badhost2).domain.com
Thanks for the help, BM
participants (4)
-
bill.matthews@gmail.com
-
Galen.Johnson@sas.com
-
henrik@hswn.dk
-
Ken.Cooper@Intelliverse.com