New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
CPU usage alarm
Hello,
I have some gameservers and sometimes they need a high CPU usage, that's why I get a warning from my hoster. Of course I would like to avoid that and I'm asking myself if there is a script which checks the cpu usage and if it's above a fixed value, send me an email or something like that.
Thanks in advance for your help
Comments
lfd?
Thanks! Looks good but is it possible to automatically send emails when the cpu usage is to high?
@trexos - Create free NewRelic account, install monitoring agent and configure the thresholds
You can do that with monit.
If all you want is an email when your cpu usage goes to high, you don't need to install anything fancy. You could use one of the many monitoring/alerting apps like the dudes above suggested, but <10 lines of bash combined with smtp-cli would do the job.
Lots of options mentioned. We'll throw our hat in the ring too - NodePing.com
new relic or scale extreme is better, even send you a sms!
this script will automatically restart apache2 if the load gets above a value you set (change the value on the line check -gt 8 to whatever you need) and will also restart it if apache2 goes down.
/bin/apache2checker >/dev/null 2>&1 instead of the one in the script notes.