rmtstats is a Python-based remote system monitoring tool that fetches and displays real-time system statistics from a remote server using SSH. It provides a simple graphical interface to view the top processes running on the remote machine, sorted by memory usage.
- Real-time monitoring of remote system statistics
- Secure connection via SSH
- Graphical display of top processes
- Automatic reconnection attempts if the target becomes unavailable
- Graceful handling of connection errors and interruptions
- Python 3.x
- GTK 4.0
- Required Python packages:
- gi (PyGObject)
- paramiko
- requests
- logging
- psutil
- Ensure you have Python 3.x installed on your system.
- Install the required packages.
- The script establishes an SSH connection to the specified remote server.
- It runs the
top
command on the remote server to fetch system statistics. - The fetched data is displayed in a GTK window, which updates every second.
- The display shows the top processes sorted by memory usage.
- If the connection is lost, the script will attempt to reconnect automatically.
BoxedLabel
: This is a GTK window class used to display remote statistics.FetchRemoteStats
: This class is a thread that continuously fetches remote stats from the server.CheckStatus
: This class checks the network interface status and pings the target machine to verify reachability.fetch_top_info
: This function retrieves and parses thetop
command output via SSH from a remote server.
- The script logs various events and errors for debugging purposes.
- It handles SSH connection failures and retries connections when the target is unavailable.
- Graceful shutdown is implemented to handle keyboard interrupts (Ctrl+C).
- You can adjust the
TOP_PROCESS_QTY
variable to change the number of processes displayed. - The update interval can be modified by changing the argument in
GLib.timeout_add_seconds()
.
- The script uses password-based SSH authentication. For improved security, consider implementing key-based authentication.
- Ensure that you're using this tool on a secure network and with appropriate permissions.
- The current version is designed for Linux-based remote systems.
- The script does not support SSH key-based authentication in its current form.
Contributions to improve rmtstats are welcome. Please feel free to submit pull requests or open issues for bugs and feature requests.
MIT license
This tool is provided as-is, without any warranties. Use it at your own risk and ensure you have the necessary permissions to monitor the remote system.