This Rust application provides a simple interface to monitor CPU and memory usage of processes running on your system. It allows users to filter and select a process from the list and displays real-time CPU and memory usage using colored graphs.
- Process Filtering: Filter processes by name.
- Interactive Selection: Choose a process to monitor from a filtered list.
- Real-time Monitoring: View real-time CPU and memory usage of the selected process.
- Graphical Display: CPU and memory usage are displayed as colored lines on a graph.
- Rust programming environment.
- Dependencies:
sysinfo
,dialoguer
,rgb
,textplots
.
- Clone the repository:
git clone https://github.com/s00d/monit-tool
- Navigate to the directory:
cd ./monit-tool
- Build the project:
cargo build --release
Before installing the monit-tool
package, you need to install Rust. Rust is a programming language that the package is built with. Here are the steps to install Rust:
-
Open a terminal or command prompt.
-
Visit the official Rust website at https://www.rust-lang.org/.
-
Follow the instructions on the website to download and install Rust for your operating system.
-
After the installation is complete, verify that Rust is installed correctly by running the following command in your terminal:
rustc --version
You can install the monit-tool
package using the cargo
utility. Make sure you have Rust compiler and cargo
tool installed.
-
Open a terminal or command prompt.
-
Run the following command to install the package:
cargo install monit-tool
- Run the program:
monit-tool
- Enter a filter to search for a specific process or leave it blank to list all processes.
- Select a process from the list to monitor.
- The program will display real-time CPU and memory usage on a graphical chart.
The monit-tool
application accepts the following command-line parameters:
--name
or-n
: (Optional) Filter processes by their name. If you provide a name, the application will display only those processes whose names contain the specified string. For example,monit-tool --name firefox
will display processes related to Firefox. If you do not specify this parameter, the application will list all running processes.--watch
or-w
: (Optional) Enables continuous monitoring of the selected process. If the selected process terminates and then restarts, the application will automatically continue monitoring the new instance of this process. This is particularly useful for tracking processes that may restart during observation.--version
: Displays the version information of themonit-tool
application.--help
: Provides help information, displaying the available command-line options and their usage.--logging
or-l
: (Optional) Enables logging of monitoring data to a log file. If this option is enabled, the application will create a log file with a timestamped name to record the monitoring data. The log file will include CPU usage, memory usage, and, if enabled, disk write and disk read information for the selected process.--disk-write
: (Optional) Enables monitoring and display of disk write activity for the selected process. If this option is enabled, the application will include information about disk write usage in the monitoring chart.--disk-read
: (Optional) Enables monitoring and display of disk read activity for the selected process. If this option is enabled, the application will include information about disk read usage in the monitoring chart.
Example usage with parameters:
monit-tool --name nginx --watch
This command filters the process list for 'nginx' and enables continuous monitoring, even if the 'nginx' process restarts.
- Modify the graph dimensions or the refresh rate in the main loop for different display preferences.
Contributions, issues, and feature requests are welcome. Feel free to check issues page if you want to contribute.
Distributed under the MIT License. See LICENSE
for more information.