Skip to content

A fast, Rust-powered network monitoring tool inspired by PRTG. Monitor network health, track live logs, and detect failures in real-time. Lightweight, efficient, and built for reliability.

License

Notifications You must be signed in to change notification settings

karthik558/Rust-Ping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

50 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ RustPing: Real-time Network Monitoring

Rust Rocket License: MIT Build Status

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.

✨ Features

  • πŸ” 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.

🚧 Roadmap

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.

πŸ“Έ Screenshots

Dark Mode Light Mode
Auth-Dark Auth-Light
Login-Dark Login-Light
Pass-Reset-Dark Pass-Reset-Light
Device-Dark Device-Light
Dashboard-Dark Dashboard-Light
Live-Log-Dark Live-Log-Light
Fail-Log-Dark Fail-Log-Light

πŸ“– Table of Contents

βš™οΈ Prerequisites

  • 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.

πŸ› οΈ Installation

Installation (Linux/MacOS)

  1. Clone the Repository:

    git clone https://github.com/karthik558/Rust-Ping.git
    cd Rust-Ping
  2. Build the Project (Release Mode):

    cargo build --release

    This creates an optimized executable in the target/release directory.

  3. Run the Application:

    ./target/release/Rust-Ping  # Run the compiled executable directly

    Alternatively use cargo:

     cargo run
  4. Access the Dashboard: Open your web browser and navigate to http://127.0.0.1:8000/static/index.html.

Installation (Windows)

  1. Clone the Repository:

    git clone https://github.com/karthik558/Rust-Ping.git
    cd Rust-Ping
  2. Install MSYS2: Follow the instructions on the MSYS2 website to install it. This provides the necessary build tools.

  3. Rust Installation (if not already installed): Follow the instructions on Rust website to install Rust.

  4. Alternative MinGW Installation (if msys2 not working): Download and install MinGW-w64 from MinGW-w64 installer

  5. 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

  6. Set Rustup Default (Important!):

rustup default stable-x86_64-pc-windows-gnu

Verify with:

rustup show
  1. 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
  2. Build the Project:

    cargo build --release
  3. Run the Application:

     cargo run

    or (better for deployment):

    .\target\release\Rust-Ping.exe
  4. 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).

πŸ”‘ Default Password for WebUI

  • Username: admin
  • Password: admin

Important: Change the default password immediately after your first login for security reasons!

βš™οΈ Configuration (Optional)

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 or https://www.example.com).

πŸš€ Usage

  1. Access the Dashboard: Open http://127.0.0.1:8000/ (or /static/index.html) in your web browser.
  2. Configure Devices: Edit the devices.json file as described above.
  3. Automatic Refresh: The dashboard automatically refreshes every 5 seconds to display the latest device status.
  4. View Details: Click on entries in the tables to see more detailed information.
  5. Export Logs: Use the log export form to generate CSV or TXT files of your monitoring data.

πŸ–₯️ Adding Devices

  1. Access the Dashboard: Open http://127.0.0.1:8000/static/manage-devices.html in your web browser.
  2. 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.
  3. 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).
  4. 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).
  5. Delete Device: Click on the "Delete" button next to the device you want to remove. Confirm the deletion in the popup dialog.

πŸ“‘ API Endpoints

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.

🀝 Contributing

Contributions are always welcome! Here's how you can help:

  1. Fork the Repository: Create a copy of the repository on your GitHub account.
  2. Create a Branch: Make your changes in a new branch: git checkout -b my-feature-branch
  3. Make Changes: Implement your feature or fix the bug.
  4. Write Tests: Add tests to ensure your code works correctly and doesn't break existing functionality.
  5. Commit Changes: git commit -m "Add a descriptive commit message"
  6. Push to Your Fork: git push origin my-feature-branch
  7. Submit a Pull Request: Open a pull request from your branch to the main RustPing repository.

Please follow the Rust style guidelines.

πŸ“„ License

This project is licensed under the MIT License.

About

A fast, Rust-powered network monitoring tool inspired by PRTG. Monitor network health, track live logs, and detect failures in real-time. Lightweight, efficient, and built for reliability.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published