[Xymon] HOST regex
Root, Paul T
Paul.Root at CenturyLink.com
Mon Dec 4 22:17:01 CET 2017
Ah, I see, I was adding more machines with a , after the regex, but that's treated as part of the regex, and the [] vs () for numbers.
Thanks,
Paul.
From: Mills,David (HHSC Contractor) [mailto:David.Mills at hhsc.state.tx.us]
Sent: Monday, December 04, 2017 2:56 PM
To: Root, Paul T; xymon at xymon.com
Subject: RE: HOST regex
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<mailto: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.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20171204/581ec645/attachment.html>
More information about the Xymon
mailing list