This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Script : CPU alert
#1
Brick 
Hi everybody,

Is there anyone who know how to have the CPU charge of the system ?

In fact we'd like to get an alert, in case of CPU overclocked...

Thanks for your solutions,
Best regards,
Hubert FEBRAUD
Home automation integrator
Connectibat, Nantes, France
Reply
#2
Here you have this script:
Code:
f = assert (io.popen("cat /proc/loadavg"))
loadavg = {}
for line in f:lines() do
 table.insert(loadavg, line)
end -- for loop
 
f:close()

log(loadavg)

First 3 values means averaged 1min, 5min, 15min where 0 means 0% and 1 means 100%. Further values are current number of runnable tasks and the process ID of the process that most recently ran.

See also:
http://www.loadavg.com/2012/01/what-is-loadavg/
Reply
#3
Thanks a lot buuuudzik, it works !

Have a nice day
Reply
#4
You're welcomeSmile
Reply


Forum Jump: