Discussion in 'Tomato Firmware' started by besonen, Aug 28, 2009.
how can i log the 'CPU Load' stat?
you could create a script that is executed into background upon init and writes the contents of /proc/loadavg into a file every n seconds (or minutes). your only problem will then be cycling the contents of that file in case it gets too big. loadavg's output usually has a size of around 23-26 chracters, depending on the amount of processes executed (read: PIDs created) of the router.
if you log, say, every 5 seconds, that amounts to 421KiB every day. at that rate, your ram would be full after a couple of days.
i guess the way this could be implemented relies heavily on the way you want to access the data, and how much of it you actually need.
logger "LOADAVG: $(cat /proc/loadavg)"