Reg Exp matching in hobbit-clients.cfg
list Bill Matthews
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
list Henrik Størner
▸
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
list Ken Cooper
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:user-8dc497641099@xymon.invalid]
Sent: Wednesday, August 29, 2007 11:19 AM
To: user-ae9b8668bcde@xymon.invalid
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
list Galen Johnson
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:user-855b6a08face@xymon.invalid]
Sent: Wednesday, August 29, 2007 11:39 AM
To: user-ae9b8668bcde@xymon.invalid
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:user-8dc497641099@xymon.invalid]
Sent: Wednesday, August 29, 2007 11:19 AM
To: user-ae9b8668bcde@xymon.invalid
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
list Ken Cooper
It was actually an IGNORE HOST, we used it to turn on and off monitoring of a complete datacenter.
▸
From: Galen Johnson [mailto:user-87f955643e3d@xymon.invalid]
Sent: Wednesday, August 29, 2007 12:31 PM
To: user-ae9b8668bcde@xymon.invalid
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:user-855b6a08face@xymon.invalid]
Sent: Wednesday, August 29, 2007 11:39 AM
To: user-ae9b8668bcde@xymon.invalid
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:user-8dc497641099@xymon.invalid]
Sent: Wednesday, August 29, 2007 11:19 AM
To: user-ae9b8668bcde@xymon.invalid
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
list Bill Matthews
Thanks Henrik, both of those worked perfectly. I'm in business! Regards, BM