123Solar is a lightweight set of PHP/JS files that makes a web logger to monitor your photovoltaic inverter(s). It just need a web server and PHP, no databases are even needed. The philosophy is: To keep it simple, fast, with a low foot print to run on cheap and low powered devices.
This PR resolves #29 by using the same commands across all major Linux distributions to retrieve CPU, Memory and Disk information. It has been tested on:
Debian 11
Raspbian 11
Centos 8
Fedora 36
OpenSuse Tumbleweed
Archlinux
Commands have same output across x86, x64 and ARM architectures.
In details:
For the CPU the top command is used in order to have current CPU usage, independently of the total process time, that is the one reported from ps; this has a +20% difference on the reported value on low power devices like a Raspberry. Moreover the reported value is already normalized by the number of CPUs available, so a 100% means all CPUs are busy.
In the Memory section, the reported free value is always the available one returned by the free command. This is because the user is interested on how much memory can be used to launch programs, instead of how much is not used.
Also a small UI tweak has been done in the info page to state more clearly which value represent used and available disk space.
This PR resolves #29 by using the same commands across all major Linux distributions to retrieve CPU, Memory and Disk information. It has been tested on:
Commands have same output across x86, x64 and ARM architectures.
In details: For the CPU the
top
command is used in order to have current CPU usage, independently of the total process time, that is the one reported fromps
; this has a +20% difference on the reported value on low power devices like a Raspberry. Moreover the reported value is already normalized by the number of CPUs available, so a 100% means all CPUs are busy.In the Memory section, the reported free value is always the
available
one returned by thefree
command. This is because the user is interested on how much memory can be used to launch programs, instead of how much is not used.Also a small UI tweak has been done in the info page to state more clearly which value represent
used
andavailable
disk space.Before:![before](https://user-images.githubusercontent.com/1374430/183667201-2190d5df-1bbe-4121-b0f4-b8d7214eb0cb.png)
After:![after](https://user-images.githubusercontent.com/1374430/183667243-0f7357a2-9801-48bf-89a9-a5b325ec7397.png)