Skip to content

guillermodean/network-scanner

Repository files navigation

Network Scanner Web App

A comprehensive network scanning and device management web application that runs in a Docker container. This app scans your network, identifies devices, tracks connection speeds, and allows you to manage device information.

Features

  • 🔍 Network Scanning: Automatically discovers devices on your network
  • 📱 Device Detection: Identifies IP addresses, MAC addresses, hostnames, and device types
  • Connection Speed Monitoring: Tests and tracks connection speeds for each device
  • 🔄 Automatic Updates: Connection speeds are refreshed every 30 minutes automatically
  • ✏️ Device Management: Edit and update device information manually
  • 💾 Persistent Storage: All device information is stored in a database
  • 🐳 Docker Ready: Easy deployment with Docker and Docker Compose

Requirements

  • Docker and Docker Compose
  • Network access (requires privileged mode for network scanning)

Quick Start

  1. Clone or download this repository

  2. Build and run with Docker Compose:

    docker-compose up -d
  3. Access the web interface: Open your browser and navigate to http://localhost:8100

Usage

Scanning Your Network

  1. Click the "Scan Network" button to discover devices
  2. Optionally specify a network range (e.g., 192.168.1.0/24) or leave empty for auto-detection
  3. The scan will discover all active devices and add them to the database

Managing Devices

  • View Devices: All discovered devices are displayed in cards showing:

    • IP and MAC addresses
    • Device type and manufacturer
    • Connection speed
    • Last seen timestamp
    • Custom notes
  • Edit Device: Click the "Edit" button on any device card to:

    • Update hostname
    • Change device type
    • Add manufacturer/vendor information
    • Add OS information
    • Add custom notes
  • Delete Device: Click "Delete" to remove a device from the list

Connection Speed Testing

  • Manual Update: Click "Update Speeds" to manually test all device speeds
  • Automatic Updates: Speeds are automatically updated every 30 minutes
  • Speed history is stored and can be viewed via the API

API Endpoints

Devices

  • GET /api/devices/ - Get all devices
  • GET /api/devices/{id} - Get specific device
  • PUT /api/devices/{id} - Update device information
  • DELETE /api/devices/{id} - Delete device
  • GET /api/devices/{id}/speed-history - Get speed history for device

Scanning

  • POST /api/scan/ - Scan network (optional network parameter)
  • POST /api/scan/update-speeds - Manually update all device speeds

Configuration

Environment Variables

  • DATABASE_URL: Database connection string (default: sqlite:///./data/network_scanner.db)

Docker Configuration

The app runs with:

  • Privileged mode: Required for network scanning capabilities
  • Host network mode: Allows access to the host network for scanning
  • Volume mount: Database is stored in ./data directory

Data Persistence

The database file is stored in the ./data directory, which is mounted as a volume. This ensures your device information persists across container restarts.

Troubleshooting

Network Scanning Issues

  • Ensure the container has proper network permissions
  • On some systems, you may need to run with --cap-add=NET_ADMIN
  • Check that nmap is installed in the container (it should be via the Dockerfile)

Speed Testing

  • Speed testing uses ping-based latency measurements
  • Some devices may not respond to ping, resulting in no speed data
  • Firewall rules may affect speed test accuracy

Development

To run locally without Docker:

  1. Install dependencies:

    pip install -r requirements.txt
  2. Install system dependencies:

    • nmap (for network scanning)
    • Network utilities (ping, etc.)
  3. Run the application:

    uvicorn app.main:app --reload

License

This project is open source and available for personal use.

About

A comprehensive network scanning and device management web application that runs in a Docker container. This app scans your network, identifies devices, tracks connection speeds, and allows you to manage device information.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors