"^.*OutOfMemoryError.*$" this doesnt make sense to me :)
your expression should be "OutOfMemoryError" Same for the rest, beware that monit probably dont use pure perl regexp so it may be greedy may explain why you receive fake mail. On Tue, Jun 18, 2013 at 7:00 AM, Hendrik Hasenbein < [email protected]> wrote: > 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 [email protected] but not on { instance } > mail-format { > from: [email protected] > 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 > -- > To unsubscribe: > https://lists.nongnu.org/mailman/listinfo/monit-general > -- --------------------------------------------------------------------------------------------------------------------- () ascii ribbon campaign - against html e-mail /\
-- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general
