[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MONIT: If match FOO and BAR then alert
From: |
address@hidden |
Subject: |
Re: MONIT: If match FOO and BAR then alert |
Date: |
Mon, 11 Apr 2016 01:51:29 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 |
Hi,
yes I got it. I also could handle the quotes withing the log string by
using semicolons. e.g.: ignore match 'cause":5'
Thanks!
Am 10.04.2016 um 15:33 schrieb Martin Pala:
> Hi,
>
> the content match test uses a regular expression ... you can just specify a
> pattern, which will match the content you want ("FOO and BAR" shouldn't be
> problem).
>
> Regards,
> Martin
>
>
>> On 09 Apr 2016, at 00:20, address@hidden wrote:
>>
>> My logfiles look like this:
>>
>> {"level":"info",
>> "message":"Fork",
>> "timestamp":"2016-04-04 01:30:40",
>> "data":
>> {"delegate":"018dac7f44fe0a48b21dccb8b5f10f3023e4496aa19ad31dbe9dc8c216c3222f",
>> "block": {"id":"13079141691421199733",
>> "timestamp":31128640,
>> "height":433168,
>> "previousBlock":"10210628104998625034"},
>> "cause":5}}
>>
>> Important are only "Fork" and "cause":5
>>
>> I am using following config currently to alarm "Fork" but I want to
>> combine it with different "causes".
>>
>> # BEGIN OF SCRIPT
>> check file messages with path /home/username/software/logs.log
>> if match "Fork" then alert
>> # END OF SCRIPT
>>
>> - How does the script have to look like if I only want alerts if a log
>> matches "Fork" and "cause":1 and "cause":2?
>>
>> - And what about the quotes in my logfiles? I think it's better to
>> ignore all quotes because they are part of the config file, or? I hope
>> you know what I mean.
>>
>> Thanks in advance for your help!
>>
>>
>>
>> --
>> To unsubscribe:
>> https://lists.nongnu.org/mailman/listinfo/monit-general
>
>
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general
>