[Xymon] HOST regex

Bakkies Gatvol bakgat8 at hotmail.com
Wed Dec 6 21:36:23 CET 2017


Please help me too!


aburtssom01.auca.corp
aburtssom02.auca.corp
aburtssom03.auca.corp
aburtssom04.auca.corp

astptoemm01.auca.corp

aburtssom01.auca.corp
aburtssom02.auca.corp
aburtssom03.auca.corp
aburtssom04.auca.corp



HOST=%((a(burt|scop)ssom0(1|2).auca.corp)|astptoemm01.auca.corp)


will this work?


and then how to I exclude it from a CLASS lower down?


CLASS=linux EXHOST=%*.auca.corp


could I



CLASS=linux EXHOST=%((a(burt|scop)ssom0(1|2).auca.corp)|astptoemm01.auca.corp)


________________________________
From: Xymon <xymon-bounces at xymon.com> on behalf of Root, Paul T <Paul.Root at CenturyLink.com>
Sent: Monday, December 4, 2017 4:17 PM
To: 'Mills,David (HHSC Contractor)'; xymon at xymon.com
Subject: Re: [Xymon] HOST regex


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/20171206/b67465d5/attachment.html>


More information about the Xymon mailing list