[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
set alert and generated alerts
From: |
Hendrik Hasenbein |
Subject: |
set alert and generated alerts |
Date: |
Tue, 18 Jun 2013 13:00:45 +0200 |
Hi,
I am in the process of setting up monit to watch over a big amount of tomcats.
The configurations are generated for each running tomcat and deposited in a
conf.d. I run into two problems:
I tried to limit the amount of mails by including "but not on { instance,
nonexist }", but it seems I still get a mail for each monitor/unmonitor for
each check.
The second problem is that each mail contains the same $SERVICE. $ACTION is
honored (changes between batches of mail).
The checks are grouped into a file per tomcat with a single check looking like:
---snip
check file xxxxxxxx-xxxxxxxxxx-xxx-xxxx-su1-slow-requests with path
/opt/xxxx/xxxx-xxxxxxx/TomC/xxx-xxx-xxxx-su1/logs/slow-requests.log
group "xxxxxxxx-xxxxxxxxxx-xxx-xxxx-su1"
if match
"^.*OutOfMemoryError.*$"
then exec "/etc/monit/tools/tomcat-restart.sh
/opt/xxxx/xxxx-xxxxxxx/TomC/xxx-xxx-xxxx-su1" as uid tomcat and gid tomcat
if match
"^.*SEVERE: All threads .* are currently busy.*$"
then exec "/etc/monit/tools/tomcat-restart.sh
/opt/xxxx/xxxx-xxxxxxx/TomC/xxx-xxx-xxxx-su1" as uid tomcat and gid tomcat
set alert address@hidden but not on { instance }
mail-format {
from: address@hidden
subject: $SERVICE $EVENT at $DATE
message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION.
best regards,
Hendrik Hasenbein
}
set mailserver x.24translate.de
---snap
The attached file contains a full group.
Thanks in advance,
Hendrik Hasenbein
example.conf
Description: Binary data
- set alert and generated alerts,
Hendrik Hasenbein <=