monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MONIT: If match FOO and BAR then alert


From: address@hidden
Subject: MONIT: If match FOO and BAR then alert
Date: Sat, 9 Apr 2016 00:20:03 +0200
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

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!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]