This works
HOST=%_ip_printer SERVICE=conn
matches any host ending in %_ip_printer
../bin/xymoncmd xymond_alert --test DGMSA_HP4050_ip_printer conn
00017968 2016-07-27 12:35:29 *** Match with 'HOST=%_ip_printer SERVICE=conn' ***
what I want to match now
usphl0tsasdbv0 usphl0tsasvav1
I tried
HOST=usphl0tsas% SERVICE=disk_app
but it does not match
00017809 2016-07-27 12:34:21 Matching host:service:dgroup:page 'usphl0tsasvav1:disk_app:NONE:test' against rule line 30 00017809 2016-07-27 12:34:21 Failed 'HOST=usphl0tsas% SERVICE=disk_app' (hostname not in include list)
Is there any way to have the wildcard be at the end?
Thanks
On 7/27/2016 8:38 AM, Bakkies Gatvol wrote:
This works
HOST=%_ip_printer SERVICE=conn
matches any host ending in %_ip_printer
No, the percent character is not a wildcard. It indicates that what follows is a regular expression. Yours matches any host _containing_ "_ip_printer"
http://perldoc.perl.org/5.8.8/perlre.html
what I want to match now
usphl0tsasdbv0 usphl0tsasvav1
HOST=%foo.
Would match any host containing "foo" followed by any other character. That gets close to what you want in the fewest characters. But it will match "food" just as well as "shesafool" or "ofoo8".
HOST=%^foo.
requires that the host name begin with "foo" and is followed by any character. This would match "food", and "foo8".
host=%^foo\d
requires the hostname begins with "foo" and is followed by a digit.
-- Do things because you should, not just because you can.
John Thurston 907-465-8591 John.Thurston at alaska.gov Enterprise Technology Services Department of Administration State of Alaska
Thanks!!! john.thurston
what I really really wanted t=test d=dev p=prod etc
*** Match with 'HOST=%^usphl0(p|d|t)sas\w+ SERVICE=disk_app' ***
To: xymon at xymon.com From: john.thurston at alaska.gov Date: Wed, 27 Jul 2016 09:00:47 -0800 Subject: Re: [Xymon] alert configuration wildcard HOST
On 7/27/2016 8:38 AM, Bakkies Gatvol wrote:
This works
HOST=%_ip_printer SERVICE=conn
matches any host ending in %_ip_printer
No, the percent character is not a wildcard. It indicates that what follows is a regular expression. Yours matches any host _containing_ "_ip_printer"
http://perldoc.perl.org/5.8.8/perlre.html
what I want to match now
usphl0tsasdbv0 usphl0tsasvav1
HOST=%foo.
Would match any host containing "foo" followed by any other character. That gets close to what you want in the fewest characters. But it will match "food" just as well as "shesafool" or "ofoo8".
HOST=%^foo.
requires that the host name begin with "foo" and is followed by any character. This would match "food", and "foo8".
host=%^foo\d
requires the hostname begins with "foo" and is followed by a digit.
-- Do things because you should, not just because you can.
John Thurston 907-465-8591 John.Thurston at alaska.gov Enterprise Technology Services Department of Administration State of Alaska
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
participants (2)
-
bakgat8@hotmail.com
-
john.thurston@alaska.gov