Results 1 to 3 of 3
Hi I am a total newbie and im sorry if I sound dumb or havent found this in another area of the forums.
I need a simple script that will ...
- 02-01-2010 #1Just Joined!
- Join Date
- Feb 2010
- Posts
- 1
monitor CPU usage
Hi I am a total newbie and im sorry if I sound dumb or havent found this in another area of the forums.
I need a simple script that will check the CPU usage of my linux box. Compare that usage to a threshold e.g. 90% and if the CPU usage is equal too or more than 90% it calls another script. I already have the other script I just need something that will check the CPU and check if its above my threshold which I would have hard set in the script somewhere I imagine.
One other thing, this linux box is multiprocessor so if I do the top command I will see 4 CPU's. I need to check if any of these are above the threshold.
I will be putting this script in as a cron job to run every X minutes ( havent gotten that far yet)
Please help me or I will loose my job (not really but it will help me loads)
- 02-02-2010 #2
Re: monitor CPU usage
I don't have a complete solution for your problem but I will recommend trying Conky. It's a system monitor that runs on your desktop. In case you're wondering, yes, it will work with a multi-core processor.
I know Conky has an API for Lua so it may still be possible to implement a script that solves your issue.
- 02-02-2010 #3
look into sar, should be in a package called sysstat for most distros


Reply With Quote