Native Linux commands provide useful data about the current system status and health. However, each one of those Linux commands and utilities are focused on getting data from only one aspect of the system. We need to leverage Python modules to get those details back to the administrator and generate useful system reports.
We will divide the reports into two parts. The first one is getting general information about the system by using the platform module, while the second part is exploring the hardware resources in terms of the CPU and memory.
We will start by leveraging the platform module, which is a built-in library inside of Python. The platform module contains many methods that can be used to get details about the system that Python operates on:
import platform
system = platform.system()
print(system)
Running the same script on a Windows machine will...