[Xymon] can you use patterns in EXHOST ?

Bakkies Gatvol bakgat8 at hotmail.com
Thu Dec 7 03:55:12 CET 2017


It dawned on me there are regex tools online!


https://regexr.com/

[https://regexr.com/assets/card.png]<https://regexr.com/>

RegExr: Learn, Build, & Test RegEx<https://regexr.com/>
regexr.com
Regular expression tester with syntax highlighting, PHP / PCRE & JS Support, contextual help, cheat sheet, reference, and searchable community patterns.



I used above (on PCRE)  and came up with this


CLASS=linux EXHOST=%((a|u)*.yyy.xxx)


that seems to be performing as required


I even went back to another grouping and it looks like this is working - using a regexp in HOST and then using the same in EXHOST


HOST=%(as(cop|tpt)hpux[0-9][0-9])

CLASS=hp-ux EXHOST=%(as(cop|tpt)hpux[0-9][0-9])

________________________________
From: Xymon <xymon-bounces at xymon.com> on behalf of Bakkies Gatvol <bakgat8 at hotmail.com>
Sent: Wednesday, December 6, 2017 7:31 PM
To: Xymon Mailing List
Subject: Re: [Xymon] can you use patterns in EXHOST ?


This seems to be working now.


CLASS=linux EXHOST=%(a*.yyy.xxx)


this did not work EXHOST=%a*.yyy.xxx  ... do you need more () when you're using a * ?


I hope EXHOST=%(*.yyy.xxx) works as well because that's what I really need!


If anyone has a good set of RE pattern examples for HOST and EXHOST - or can point me too some - I would be VERY grateful. I have not quite got the hang of it.


B





________________________________
From: Xymon <xymon-bounces at xymon.com> on behalf of Bakkies Gatvol <bakgat8 at hotmail.com>
Sent: Wednesday, December 6, 2017 6:28 PM
To: Xymon Mailing List
Subject: [Xymon] can you use patterns in EXHOST ?


In analysis.cfg

I have a CLASS=linux section that works fine. Fine for *our* hosts - the ones we built.


Now I have to monitor a whole datacenter of other linux boxes that do not adhere to *our* standards.


I added the new linux boxes into Xymon with longname ( host.yyy.xxx ) - my hosts are all shortname. Please tell me how I can exclude every linux host ending in yyy.xxx from CLASS=linux.


It is not really practical to list 150 hosts by LONGname in EXHOST.


Fingers crossed that this is possible!


Bakkies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20171207/fb2c9bd7/attachment.html>


More information about the Xymon mailing list