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.

System Load Variable
#1
Hi @all,

is there an option to call the actual system / processor load in a script? 

I haven’t found anything in the LUA reference manual.

Many thanks for your help!

Best regards 
Steffen
Reply
#2
Resident script with a 60-second sleep interval. 
Create two 2-byte objects and name them CPU and Memory.
Code:
load = io.readfile('/proc/loadavg'):split(' ')[ 1 ]
memtotal = data:match('MemTotal:%s+(%d+)')
memavail = data:match('MemAvailable:%s+(%d+)')
memusage = math.floor((memtotal - memavail) / memtotal * 1000) / 10
log(load, memusage)
grp.update('CPU', load)
grp.update('Memory', memusage)
Reply
#3
Check this: https://forum.logicmachine.net/showthread.php?tid=2233
Reply


Forum Jump: