Dir monitoring
list Michael Beatty
2 Problems with monitoring DIR I am trying to monitor the log directory of MQ. I have two types of primary and backup systems. On the primary system I want to monitor /backup/local/mq. On the backup I want to monitor /var/mqm/log/*/active The hosts names are formatted "LAB01" for primary systems and "LAB01_2" for backup. In my client_local.cfg file I have: [linux] log:/var/log/messages:10240 ignore MARK dir:/backup/local/mq dir:/var/mqm/log/*/active in my analysis.cfg file I have: HOST=%LAB\d\d$ DIR /backup/local/mq yellow SIZE<250000 TRACK=Backup HOST=%_2$ DIR /var/mqm/log/*/active yellow SIZE<14000 TRACK=Backup Problem #1 - the DIR check on /var/mqm/log/*/active fails. "Could not determine size of directory". However, if I click the link it says: [dir:/var/mqm/log/*/active] 49240 /var/mqm/log/QA_POSLAB05_QM/active Problem #2 - Even though I'm only specifying the DIR check of /backup/local/mq on LAB01 systems, it appears to be running on LAB01_2 systems. Though this may not be the case as the history chart is not showing any data. -- Michael Beatty
list Michael Beatty
Well, I'm down to one problem I figured out the first problem by reading the man pages for analysis.cfg and client-local.cfg. Go figure My client-local.cfg needed a command dir:`find /var/mqm/log/*/active` and my analysis.cfg needed a regular expression DIR %/var/mqm/log/*/active$ yellow SIZE<25000 So, my checks are now checking. However, ALL of the checks for all of the directories listed in the client-local.cfg are being listed for all of the hosts regardless of what tags I have in the analysis.cfg. My assumption here is that the web page will display ALL the data that is sent from client-local.cfg, but will only alert on what is configured in analysis.cfg? Is this correct? If so, it would appear that I need to setup wildcards for host names in client-local.cfg... is this supported? Michael Beatty Sherwin-Williams IT Analyst/Developer user-4aea7c115850@xymon.invalid XXX-XXX-XXXX
▸
Michael Beatty wrote:2 Problems with monitoring DIR I am trying to monitor the log directory of MQ. I have two types of primary and backup systems. On the primary system I want to monitor /backup/local/mq. On the backup I want to monitor /var/mqm/log/*/active The hosts names are formatted "LAB01" for primary systems and "LAB01_2" for backup. In my client_local.cfg file I have: [linux] log:/var/log/messages:10240 ignore MARK dir:/backup/local/mq dir:/var/mqm/log/*/active in my analysis.cfg file I have: HOST=%LAB\d\d$ DIR /backup/local/mq yellow SIZE<250000 TRACK=Backup HOST=%_2$ DIR /var/mqm/log/*/active yellow SIZE<14000 TRACK=Backup Problem #1 - the DIR check on /var/mqm/log/*/active fails. "Could not determine size of directory". However, if I click the link it says: [dir:/var/mqm/log/*/active] 49240 /var/mqm/log/QA_POSLAB05_QM/active Problem #2 - Even though I'm only specifying the DIR check of /backup/local/mq on LAB01 systems, it appears to be running on LAB01_2 systems. Though this may not be the case as the history chart is not showing any data.
list Jeremy Laidman
On Sat, Jun 2, 2012 at 3:57 AM, Michael Beatty <user-4aea7c115850@xymon.invalid>wrote:
My client-local.cfg needed a command dir:`find /var/mqm/log/*/active`
Yes, this collects the data on the client and sends it to the server with all the rest of the client data.
and my analysis.cfg needed a regular expression DIR %/var/mqm/log/*/active$ yellow SIZE<25000
This tells the server what to look for in the client data.
▸
So, my checks are now checking. However, ALL of the checks for all of the directories listed in the client-local.cfg are being listed for all of the hosts regardless of what tags I have in the analysis.cfg. My assumption here is that the web page will display ALL the data that is sent from client-local.cfg, but will only alert on what is configured in analysis.cfg? Is this correct?
Correct. It will display all client data.
▸
If so, it would appear that I need to setup wildcards for host names in client-local.cfg... is this supported?
Or, you can be a bit trickier in your client-local.cfg file. For example: dir:`find /backup/local/mq -type d 2>/dev/null; [ "$(uname -n | grep _02)" = "" ] && find /var/mqm/log/*/active -type d 2>/dev/null` This is untested, but should demonstrate the basic idea. Play with it until the string between the backticks runs correctly on every host you want to include, and shows only the correct files for each host. Cheers Jeremy