This README provides an overview of the Python System Information Script, which utilizes the lshw utility to gather and display detailed hardware information about the system.
- Overview
- Features
- Prerequisites
- Usage
- Script Workflow
- Output
- Compatibility
- Notes
- Contribution
- Author
The Python System Information Script provides detailed insights about various components of the system using the lshw utility. It displays information on the following:
- Machine Name
- CPU
- RAM
- Display Adapter
- Network Adapter
-
Detailed System Information:
- Retrieves and displays comprehensive hardware details.
-
Automated Execution:
- Runs necessary lshw commands within a Python script, saving time and effort.
-
Easy to Use:
- No manual input required; simply execute the script.
-
Customizable:
- The script can be easily modified to include additional hardware details or format the output.
-
Python3:
The script is written in Python 3.-
To check if you have Python3 installed:
python3 --version
-
To install Python3 on Ubuntu:
sudo apt update sudo apt install python3
-
-
lshw Utility:
Thelshwutility collects and displays detailed information about the hardware configuration of the machine.-
To check if you have
lshwinstalled:lshw -version
-
To install
lshwon Ubuntu:sudo apt update sudo apt install lshw
-
-
sudo: Some commands in the script require sudo privileges. Ensure that the user running the script has the necessary permissions.
-
Ensure you have the required permissions to execute the script:
chmod +x /Py_Sys_Info.py
-
Run the script:
./Py_Sys_Info.py
-
Dependency Check:
- Ensures that lshw is installed on the system. If not, the script will display an error message.
-
Hardware Information Collection:
- Runs lshw commands to retrieve details about:
- Machine name
- CPU
- RAM
- Display adapter
- Network adapter
- Runs lshw commands to retrieve details about:
-
Data Parsing:
- Extracts and organizes the output into a user-friendly format.
-
Display Results:
- Outputs the gathered information in the terminal for easy reference.
The script provides detailed information about:
-
Machine Name:
- Hostname of the machine.
-
CPU Specifications:
- Model, speed, and number of cores.
-
RAM Details:
- Total memory capacity and usage.
-
Display Adapter:
- GPU model and specifications.
-
Network Adapter:
- Details of all network interfaces.
Example output:
Machine Name: my-laptop
CPU: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
RAM: 16 GB
Display Adapter: NVIDIA GeForce GTX 1660 Ti
Network Adapter: Intel Wireless-AC 9560-
Supported Systems:
- The script is compatible with Linux distributions that support lshw, such as Ubuntu, Debian, and their derivatives.
-
Desktop Environments:
- Desktop environment has no impact; works on both server and desktop versions of Linux.
-
Sudo Requirement:
- Since the lshw utility requires superuser privileges for certain commands, ensure you run the script with sudo.
-
Error Handling:
- If any component is not detected, the script will display a warning but continue execution.
-
Customizability:
- The script can be enhanced to include additional details or export output to a file (e.g., JSON or CSV).
Your contributions can make these scripts even better:
-
Fork the repository.
-
Create a new branch:
git checkout -b my-awesome-feature
-
Make your invaluable changes.
-
Commit your changes:
git commit -am 'Added some amazing features' -
Push to the branch:
git push origin my-awesome-feature
-
Create a new Pull Request targeting the Python directory.
Contributions are welcome! Feel free to open issues, suggest enhancements, or submit pull requests to improve the script.
- Raphael Chookagian
- 12/07/2024
-
This script is provided as-is without any warranties. Users are advised to review and understand the script before executing it.
-
This project is licensed under the MIT License. See the LICENSE file for details.