Paul -
As far as just the Perl RE goes, use this:
(iadncmds[1-6])|( iadccmds1[1-9])|...
So, in analysis.cfg: HOST=%(iadncmds[1-6])|( iadccmds1[1-9])| ... # Where the "|..." includes the rest of your hosts, following a similar pattern
Use "[]"s to specify a range of numbers, not parens...
$ perl -e 'for ($i = 0; $i <= 7; $i ++ ) { if ( "iadncmds$i" =~ /iadncmds[1-6]/ ) { print "This matches: iadncmds$i\n" } else { print "iadncmds$i does not match...\n" } }' iadncmds0 does not match... This matches: iadncmds1 This matches: iadncmds2 This matches: iadncmds3 This matches: iadncmds4 This matches: iadncmds5 This matches: iadncmds6 iadncmds7 does not match...
~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~ David Mills Systems Administrator Northrop Grumman (512) 595-1238 (mobile)
From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Root, Paul T Sent: Monday, December 4, 2017 2:46 PM To: xymon at xymon.com Subject: [Xymon] HOST regex
I'm having trouble getting a regex going for hostnames in analysis.cfg
I've got machines iadncmds1 through iadncmds6 and iadccmds1 through iadncmds9 and a couple other machines, all should/will have the same things to look at (ports, procs, etc).
I've tried the following: HOST=%iad(ncm|ccm)ds(1-9),apancmdsd1,iadncmdsd2 HOST=%iad(ncm|ccm)ds\d,apancmdsd1,iadncmdsd2 HOST=%iad(ncm|ccm)ds.*,apancmdsd1,iadncmdsd2 HOST=%iad(ncm|ccm)ds(.*),apancmdsd1,iadncmdsd2
Any help here?
Thanks, Paul.
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.