Xymon Mailing List Archive search

backticks not working in client-local.cfg

list Michael Beatty
Fri, 12 Apr 2013 11:46:04 -0400
Message-Id: <user-ae95fcd64375@xymon.invalid>

You don't need to do the date calculation in the analysis, just need to 
provide the regular expression to match it.

The client-local.cfg is telling your client what data to send, but 
supply the date string in the "find" statement, the client is going 
going to return data from those files.  So once the data gets to the 
server, it will only be for today's data.  For example, the client data 
will only have.

/mnt/logs/access.2013-04-12.log

So your regex in analysis.cfg only needs
  LOG %/mnt/logs/access\.[0-9]*-[0-9]*-[0-9]*\.log

Michael Beatty

On 04/12/2013 11:24 AM, deepak deore wrote:
You rock!

One last question, my analysis.cfg entry seems to be wrong, xymon not 
alerting for below entry which has backtrick.

 LOG %/mnt/logs/access.`date +%Y-%m-%d`.log "%Exception:" COLOR=red


On Fri, Apr 12, 2013 at 8:03 PM, Michael Beatty 
<user-4aea7c115850@xymon.invalid <mailto:user-4aea7c115850@xymon.invalid>> wrote:

    Actually.... I didn't know you had to close the backticks after
    the message size either... My original reply was a typo, I thought
    it should have gone after the ".log"  Hmm??? If it works, it works
    I guess.

    For your second question, it can be done, but not the way you have
    shown.  the client-local file won't work with multiple hostnames. 
    What id does work on, however, is a CLASS names which are defined
    in your hosts.cfg.

    So in your hosts.cfg file:
    1.2.3.1    server1  # CLASS:myclass
    1.2.3.2    server2  # CLASS:myclass
    1.2.3.3    server3  # CLASS:myclass

    In your client-local.cfg
    [myclass]
    log:....


    Michael Beatty
    Sherwin-Williams
    IT Analyst/Developer
    user-4aea7c115850@xymon.invalid  <mailto:user-4aea7c115850@xymon.invalid>
    XXX-XXX-XXXX

    On 04/12/2013 08:59 AM, deepak deore wrote:
    Hi Michael, this worked!
    Thanks a ton. I didnt know that we have to close the backtick
    after the message size.
    One more question, can I add multiple servers for common log file
    monitoring like below?

    [server1,server2,server3]
    log: .....


    On Fri, Apr 12, 2013 at 5:03 PM, Michael Beatty
    <user-4aea7c115850@xymon.invalid <mailto:user-4aea7c115850@xymon.invalid>>
    wrote:

        Try:

        log:`find /mnt/logs/access.$(date +%Y-%m-%d).log:10240`

        Michael Beatty
        Sherwin-Williams
        IT Analyst/Developer
        user-4aea7c115850@xymon.invalid  <mailto:user-4aea7c115850@xymon.invalid>
        XXX-XXX-XXXX

        On 04/12/2013 06:20 AM, deepak deore wrote:
        Xymon version: - Xymon 4.3.10
        OS: - Ubuntu 12.04 LTS

        I am using the below entry but it is not converting the date
        command to the value.

        [server-name]
        log:/mnt/logs/access.`date +%Y-%m-%d`.log:10240
        ignore INFO
        trigger SEVERE

        I tried many things but no luck, on the log page I see the
        date command as it is instead of the actual date value.: -

        log:`/mnt/logs/access.`date +%Y-%m-%d`.log`:10240
        log:$(/mnt/logs/access.`date +%Y-%m-%d`.log):10240
        log:$(echo /mnt/logs/access.`date +%Y-%m-%d`.log):10240
        log:/mnt/logs/access.$(date +%Y-%m-%d).log:10240