RustPing is a powerful, real-time network monitoring tool built with Rust and the Rocket web framework. It provides an interactive dashboard to monitor your network devices using Ping, HTTP checks, and bandwidth monitoring, all with a focus on speed, reliability, and ease of use.
- π Real-time Device Monitoring: Keep an eye on your network devices with live updates.
- π Interactive Dashboard: Visualize your network's health with intuitive charts and tables.
- π Multiple Sensors:
- Ping: Check device availability.
- HTTP: Monitor website status and response times.
- Bandwidth: Track network usage.
- π Detailed Logging: Get comprehensive logs for troubleshooting and analysis.
- π Automatic Retry: Handles intermittent network issues gracefully.
- π Visual Status Indicators: Quickly identify problems with clear visual cues.
- π / βοΈ Dark/Light Mode: Choose the theme that suits your preference.
- π Log Export: Export logs in CSV or TXT format for offline analysis.
- π User Authentication: Secure access with a login system (and planned role-based access).
- π± Responsive Design: Works seamlessly on various devices, including desktops and tablets.
- π οΈ Device Dashboard Users can add devices from front-end itself without editing the JSON.
These features are planned for future development:
- β Upcoming: User authentication and role-based access control: Control access and permissions.
- β Upcoming: Add device management features: Add, remove, and edit devices from the dashboard.
- π΄ Upcoming: New Sensors (TCP, UDP, etc.): Expand monitoring capabilities.
- π΄ Upcoming: Email/SMS Notifications: Get alerts for critical device status changes.
- π΄ Upcoming: Docker Support: Simplify deployment and portability.
- π΄ Upcoming: Mobile App: Monitor your network on the go.
Dark Mode | Light Mode |
---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
- Prerequisites
- Installation
- Default Password
- Configuration
- Usage
- Adding Devices
- API Endpoints
- Contributing
- License
- Rust: 1.56 or higher. Install from rustup.rs.
- Cargo: The Rust package manager (automatically installed with Rust).
- Network Access: RustPing needs network access to monitor your devices.
-
Clone the Repository:
git clone https://github.com/karthik558/Rust-Ping.git cd Rust-Ping
-
Build the Project (Release Mode):
cargo build --release
This creates an optimized executable in the
target/release
directory. -
Run the Application:
./target/release/Rust-Ping # Run the compiled executable directly
Alternatively use cargo:
cargo run
-
Access the Dashboard: Open your web browser and navigate to
http://127.0.0.1:8000/static/index.html
.
-
Clone the Repository:
git clone https://github.com/karthik558/Rust-Ping.git cd Rust-Ping
-
Install MSYS2: Follow the instructions on the MSYS2 website to install it. This provides the necessary build tools.
-
Rust Installation (if not already installed): Follow the instructions on Rust website to install Rust.
-
Alternative MinGW Installation (if msys2 not working): Download and install MinGW-w64 from MinGW-w64 installer
-
Add MinGW to PATH: Ensure the
bin
directory of your MinGW-w64 installation is added to your system's PATH environment variable. It should look similar to this:C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin
-
Set Rustup Default (Important!):
rustup default stable-x86_64-pc-windows-gnu
Verify with:
rustup show
-
Open a New Command Prompt: Open a new command prompt or PowerShell window after installing MSYS2 and setting the Rustup default. This ensures the environment variables are loaded correctly. Navigate to project directory:
cd Rust-Ping
-
Build the Project:
cargo build --release
-
Run the Application:
cargo run
or (better for deployment):
.\target\release\Rust-Ping.exe
-
Access the Dashboard: Open your web browser and navigate to
http://127.0.0.1:8000/
. (Note the trailing/
might be needed if you're directly running the executable).
- Username:
admin
- Password:
admin
Important: Change the default password immediately after your first login for security reasons!
The devices.json
file in the project's root directory controls which devices are monitored. Edit this file to add, remove, or modify devices. The file uses JSON format:
[
{
"name": "Router",
"ip": "192.168.1.1",
"sensors": ["Ping", "Http"],
"http_path": "http://192.168.1.1"
},
{
"name": "NAS",
"ip": "192.168.1.2",
"sensors": ["Ping"]
},
{
"name": "Example Website",
"ip": "www.example.com",
"sensors": ["Http"],
"http_path": "https://www.example.com"
}
]
name
: A descriptive name for the device.ip
: The IP address or hostname of the device.sensors
: An array of sensors to use ("Ping", "Http", "Bandwidth").http_path
: (Required for "Http" sensor) The full URL to check (e.g.,http://192.168.1.1
orhttps://www.example.com
).
- Access the Dashboard: Open
http://127.0.0.1:8000/
(or/static/index.html
) in your web browser. - Configure Devices: Edit the
devices.json
file as described above. - Automatic Refresh: The dashboard automatically refreshes every 5 seconds to display the latest device status.
- View Details: Click on entries in the tables to see more detailed information.
- Export Logs: Use the log export form to generate CSV or TXT files of your monitoring data.
- Access the Dashboard: Open
http://127.0.0.1:8000/static/manage-devices.html
in your web browser. - Add Device: Fill in the form with the device's name, IP address, Category, and sensors. Click "Add Device" to save it to the
devices.json
file. - View Devices: After adding devices, you can view them listed on the dashboard. (Note: this will be updated in real-time without needing to refresh the page but wait for a few seconds for the changes to reflect).
- Edit Device: Click on the device name to edit its details. You can change the name, IP address, and sensors. (Note: Cant edit the category for now).
- Delete Device: Click on the "Delete" button next to the device you want to remove. Confirm the deletion in the popup dialog.
RustPing provides a REST API for interacting with the application programmatically.
Method | Endpoint | Description |
---|---|---|
GET |
/ |
Serves the main dashboard HTML. |
GET |
/static/index.html |
Serves the main dashboard HTML. |
GET |
/api/devices |
Returns a JSON array of all monitored devices. |
POST |
/api/devices |
Adds a new device to the devices.json file. |
GET |
/export_log |
Initiates a download of monitoring logs. |
GET |
/log_json |
Returns logs in JSON format. |
GET |
/failed_log |
Returns logs for failed pings/HTTP checks. |
POST |
/update-password |
Updates the user's password. |
POST |
/login |
For user login. |
GET |
/logout |
Logs the current user out. |
POST |
/add_device |
Adds a new device to the devices.json file. |
POST |
/delete_device |
Deletes a device from the devices.json file. |
POST |
/update_device |
Updates an existing device in the devices.json file. |
Contributions are always welcome! Here's how you can help:
- Fork the Repository: Create a copy of the repository on your GitHub account.
- Create a Branch: Make your changes in a new branch:
git checkout -b my-feature-branch
- Make Changes: Implement your feature or fix the bug.
- Write Tests: Add tests to ensure your code works correctly and doesn't break existing functionality.
- Commit Changes:
git commit -m "Add a descriptive commit message"
- Push to Your Fork:
git push origin my-feature-branch
- Submit a Pull Request: Open a pull request from your branch to the main RustPing repository.
Please follow the Rust style guidelines.
This project is licensed under the MIT License.