Is there a way to add the CPU usage next to the traffic in/out counters on the IPFire GUI web page?
Couldn’t find an option for it so I assume this will mean hacking a config file somewhere…
And yes, I am aware that there are many types of CPU ‘usage’ so basically anything that isn’t CPU idle (i.e. Usage=1-(IdleCPU)).
One suggestion is to collect data from /proc/stat for "cpu " (there is a blank space after cpu) and do some simple calc. I might try to patch speed.cgi although I don’t know Perl but if I follow the TX, RX example, it might be doable. An interesting challenge …
Well, I decided to look into this even though I don’t know Perl. To simplify matters, /proc/loadavg provides the load average on the system like top (1 min, 5 min, 15 min). My notes:
Modify /srv/web/ipfire/cgi-bin/speed.cgi
line 77, add
my @avg = &General::system_output("cat", "/proc/loadavg");
my @usage = split(" ", $avg[0]);
pop(@usage); pop(@usage);
$load = join(' ',@usage[0..2]);