Simple Python Program to get the system status of a raspberry Pi

The following program helps you to monitor the status of a raspberry pi. The common parameters that we monitor are CPU, Memory & Disk. This program can be used to get the info of any operating system. This is not limited to raspberry pi.

Here I am providing a simple program that provides the details of all these three parameters. You can enhance this program further and make it part of your application.

Linux commands to check the disk utilization, size of directory or file

  • Command to check the disk utilization
df -h

The ‘-h’ option will provide the utilization in human readable format.

  • Command to check the size of a directory
du -sh <directory name>
  • Command to check the size of a file
du -sh <file name>
  • Command to check the size of files in a directory

Go inside the directory and execute the following command

du -sh *