monit-general
[Top][All Lists]
Advanced

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

Re: [monit] Re: what triggers resource limit?


From: Martin Pala
Subject: Re: [monit] Re: what triggers resource limit?
Date: Tue, 19 May 2009 19:31:27 +0200

Yet one thing - 100% cpu usage is not evil in general (of course it depends on context) ... in fact high CPU usage could be good since the HW is used on 100% and is not oversized (some companies watch their key performance indicators to make sure there is no excess of free resources and for example demand usage >= 50%).

Having cpu usage peaks is normal almost on every system - to prevent false alerts you can modify the cpu usage conditions to generate alert only when the cpu usage is very high for long timeframe (longer then expected peaks), for example:


    if cpu usage (user) > 90% for 5 cycles then alert
    if cpu usage (system) > 90% for 5 cycles then alert
    if cpu usage (wait) > 90% for 5 cycles then alert


=> if the usage is > 90% for 5 consecutive cycles, then alert is generated


Martin


On May 19, 2009, at 6:09 PM, Abdellah Tantan wrote:


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





reply via email to

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