The Raspberry foundation provides a tool called vcgencmd
that gives you detailed data about various hardware used in the Pi. This tool is updated from time to time and can be used to log the temperature of the GPU, voltage levels, processor frequencies, and so on.
To see a list of supported commands, type the following command in the console:
vcgencmd commands
As newer versions are released, there will be more commands available in here. To check the current GPU temperature, use the following command:
vcgencmd measure_temp
We can use the following command to check how RAM is split for the CPU and GPU:
vcgencmd get_mem arm/gpu
To check the firmware version, use the following command:
vcgencmd version
The output of all these commands is simple text that can be parsed and displayed on a website or stored in a database.