How it can be done without writing additional daemon?
P.S. I can't use cron because I need lesser time intervals.
P.P.S. Debian 6 x64
How it can be done without writing additional daemon?
P.S. I can't use cron because I need lesser time intervals.
P.P.S. Debian 6 x64
Use Monit as a lightweight system monitoring tool.
Here's the documentation. You will find examples of how to do alerts and actions depending on system conditions, like load. For example:
check system server.example.com
if loadavg (1min) > 4 for 10 cycles then alert
if loadavg (5min) > 3 for 10 cycles then alert
if loadavg (15min) > 2 for 10 cycles then alert
if memory usage > 75% for 10 cycles then alert
if cpu usage (user) > 70% for 10 cycles then alert
if cpu usage (system) > 50% for 10 cycles then alert
if cpu usage (wait) > 50% for 10 cycles then alert
Where "alert" is defined in a different configuration section.
Monit should be available in apt on Debian. Yes, it's an extra thing to install and run, but it's fairly lightweight, and it'll be better than anything you will cook up in a shell script.