I get the same email notification (resource limit) from monit but not
everyday, I am thinking that is the clamav antivirus who performs a
system
scan around midnight everyday, but the notification email is not
always
fired around midnight, It could be also freshclam that checks for
updates
every four hours. I need to keep a close eye on the Antivirus. I
will try
your suggestion. Thanks.
Abdellah
-----Original Message-----
From: address@hidden
[mailto:address@hidden On
Behalf Of
John Dixon
Sent: Tuesday, May 19, 2009 9:50 AM
To: address@hidden
Subject: [monit] Re: what triggers resource limit?
What I have done on one of my servers is to add an exec line that does
top and redirects to a file when the specific resource limit is
reached.
See below my system.conf out of /etc/monit.d/
check system hostname
if loadavg (5min) > 1 then
exec "/bin/bash -c '/usr/bin/top -b -n 1
/etc/monit.d/status_log;/bin/date >> /etc/monit.d/status_log'"
if memory usage > 50% then
exec "/bin/bash -c '/usr/bin/top -b -n 1
/etc/monit.d/status_log;/bin/date >> /etc/monit.d/status_log'"
if cpu usage (user) > 30% then
exec "/bin/bash -c '/usr/bin/top -b -n 1
/etc/monit.d/status_log;/bin/date >> /etc/monit.d/status_log'"
if cpu usage (system) > 40% then
exec "/bin/bash -c '/usr/bin/top -b -n 1
/etc/monit.d/status_log;/bin/date >> /etc/monit.d/status_log'"
if cpu usage (wait) > 35% then
exec "/bin/bash -c '/usr/bin/top -b -n 1
/etc/monit.d/status_log;/bin/date >> /etc/monit.d/status_log'"
group system
With this setup you will get notified and you will get top output in
the
status_log file. I'm sure there's a better way to write this same
thing
using the monit config syntax, but this works even if it's not pretty.
You may need to run this setup for a few days before you catch what is
using the resources because of timing, etc. Remember to clear out
your
status_log periodically or add it to a logrotate setup.
Hello,
i've got a problem with monit, i configure it to alert me when cpu
usage
is too
important, and i've got this mail :
Resource limit matched Service Intranet
Date: Mon, 18 May 2009 04:13:24 +0200
Action: alert
Host: tamtam
Description: 'Intranet' cpu user usage of 70.4% matches resource
limit [cpu
user usage>70.0%]
Resource limit matched Service Intranet
Date: Mon, 18 May 2009 04:13:25 +0200
Action: alert
Host: tamtam
Description: 'Intranet' loadavg(5min) of 2.2 matches resource limit
[loadavg(5min)>2.0]
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general