|
1 | | -# System Monitor |
2 | 1 |
|
3 | | -This Python script is a simple system monitor that displays CPU, memory, and network bandwidth usage in a terminal. It uses the `psutil` library to retrieve system information. |
| 2 | +--- |
4 | 3 |
|
5 | | -## Features |
6 | | - |
7 | | -- Displays CPU and memory usage in a visual format using hash (`#`) and hyphen (`-`) characters. |
8 | | -- Monitors network bandwidth usage and shows the received, sent, and total data transfer rates. |
9 | | -- Continuously updates the output every 0.5 seconds. |
10 | | -- Clears the terminal screen before displaying the updated output. |
11 | | - |
12 | | -## Requirements |
| 4 | +# Python System Monitor |
13 | 5 |
|
14 | | -- Python 3.x |
15 | | -- `psutil` library (install with `pip install psutil`) |
| 6 | +A terminal-based system monitor application built with Python and the `curses` library. This application provides real-time monitoring of CPU usage, memory usage, network bandwidth, system information, and running processes. |
16 | 7 |
|
17 | | -## Usage |
| 8 | +## Features |
18 | 9 |
|
19 | | -1. Clone or download the repository. |
20 | | -2. Open a terminal and navigate to the project directory. |
21 | | -3. Run the script with `python system_monitor.py`. |
22 | | -4. The output will be displayed in the terminal, updating every 0.5 seconds. |
23 | | -5. Press `Ctrl+C` to exit the program. |
| 10 | +- **CPU Usage**: Displays overall CPU usage as well as usage per core. |
| 11 | +- **Memory Usage**: Displays current memory and swap usage. |
| 12 | +- **Network Usage**: Shows network bandwidth usage. |
| 13 | +- **System Information**: Provides details about the operating system, Python version, hostname, IP address, CPU cores, RAM, and system uptime. |
| 14 | +- **Running Processes**: Lists top running processes by memory usage with the ability to highlight and kill processes using the keyboard and mouse. |
24 | 15 |
|
25 | | -## Todo |
| 16 | +## Prerequisites |
26 | 17 |
|
27 | | -The following features can be added to enhance the system monitor: |
| 18 | +- Python 3.6 or higher |
| 19 | +- `psutil` library |
28 | 20 |
|
29 | | -### System Information |
| 21 | +## Installation |
30 | 22 |
|
31 | | -Add functionality to display additional system information such as: |
| 23 | +1. Clone the repository: |
| 24 | + ```sh |
| 25 | + git clone https://github.com/Hillary520/python_system_monitor.git |
| 26 | + cd python_system_monitor |
| 27 | + ``` |
32 | 28 |
|
33 | | -- Operating system name and version |
34 | | -- System uptime |
35 | | -- CPU model and number of cores |
36 | | -- Total and available RAM |
| 29 | +2. Install the required Python libraries: |
| 30 | + ```sh |
| 31 | + pip install psutil |
| 32 | + ``` |
37 | 33 |
|
38 | | -### Running Processes |
| 34 | +## Usage |
39 | 35 |
|
40 | | -Implement a feature to display a list of currently running processes on the system, including: |
| 36 | +Run the main script to start the system monitor: |
| 37 | +```sh |
| 38 | +python3 main.py |
| 39 | +``` |
41 | 40 |
|
42 | | -- Process name |
43 | | -- Process ID (PID) |
44 | | -- CPU and memory usage for each process |
| 41 | +## Modules |
45 | 42 |
|
46 | | -You can use the `psutil.process_iter()` function to iterate over all running processes and retrieve the necessary information. |
| 43 | +- `cpu_monitor.py`: Contains the `CPUMonitor` class to get CPU usage information. |
| 44 | +- `memory_monitor.py`: Contains the `MemoryMonitor` class to get memory and swap usage. |
| 45 | +- `network_monitor.py`: Contains the `NetworkMonitor` class to get network bandwidth usage. |
| 46 | +- `system_info.py`: Contains the `SystemInfo` class to get system information. |
| 47 | +- `processes.py`: Contains the `ProcessMonitor` class to get a list of running processes. |
47 | 48 |
|
48 | | -## Contributing |
| 49 | +## Controls |
49 | 50 |
|
50 | | -Contributions are welcome! If you find any issues or have ideas for improvements, please open an issue or submit a pull request. |
| 51 | +- **Arrow Keys**: Navigate through the list of processes. |
| 52 | +- **Mouse Click**: Click to select/highlight a process. |
| 53 | +- **K**: Kill the highlighted process. |
51 | 54 |
|
0 commit comments