Skip to content

Technologies-Unlimited/Network-Monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Network Monitor

A high-performance network monitoring solution built in Go. Inspired by the excellent work of the Zabbix team, Network Monitor aims to provide similar functionality while leveraging Go's advantages in concurrency, deployment simplicity, and modern tooling.

Why Go?

While Zabbix (written in C) is an industry-proven monitoring solution, Network Monitor explores an alternative approach using Go:

  • Simpler deployment - Single static binary, no dependencies
  • Native concurrency - Goroutines and channels for efficient parallel operations
  • Memory safety - Garbage collection eliminates entire classes of bugs
  • Cross-platform - Compile for any OS/architecture from a single codebase
  • Modern tooling - Built-in testing, profiling, and package management

Operating Modes

Network Monitor supports two operating modes:

ThothOS Integrated Mode

When connected to ThothOS (technologiesunlimited.net), Network Monitor operates as a distributed proxy:

  • Multi-tenant support - Each company has isolated data and configuration
  • Centralized management - SNMP templates, ICMP templates, and IPAM data synced from ThothOS
  • Bidirectional OID sync - OIDs created locally sync to ThothOS and vice versa
  • Webhook notifications - Real-time configuration updates pushed from ThothOS
  • User authentication - Login through ThothOS with MFA support
┌─────────────────────────────────────────────────────────────┐
│                    ThothOS Cloud                            │
│  (technologiesunlimited.net)                                │
│  ├── Multi-tenant database (MongoDB)                        │
│  ├── SNMP/ICMP template management                          │
│  ├── IPAM (Supernets, Subnets, Pools, VLANs)               │
│  └── User & API key management                              │
└────────────────────────┬────────────────────────────────────┘
                         │ GraphQL API + Webhooks
                         ▼
┌─────────────────────────────────────────────────────────────┐
│           Network Monitor Proxy                             │
│  ├── Local SQLite cache                                     │
│  ├── Real-time polling (SNMP/ICMP)                         │
│  ├── Distributed nodes via gRPC                            │
│  └── Results reported back to ThothOS                       │
└─────────────────────────────────────────────────────────────┘

Standalone Mode

When ThothOS is not configured, Network Monitor runs independently:

  • No external dependencies - Fully self-contained
  • Local authentication bypass - No login required
  • Local database - All data stored in SQLite
  • Full functionality - All features available locally

To enable standalone mode, either:

  1. Don't configure ThothOS credentials, or
  2. Click "Enable Standalone Mode" on the login page

Features

  • Distributed Node Architecture - Central server with multiple monitoring nodes connected via gRPC
  • High-Speed Bandwidth Testing - 10+ Gbps throughput with 6 parallel gRPC streams
  • Real-time ICMP Monitoring - Raw socket ping monitoring for 100,000+ devices
  • SNMP Polling - SNMPv2c and SNMPv3 support with template-based polling
  • MIB Browser - Interactive SNMP browser with GET, GETNEXT, and WALK operations
  • OID Template Library - Import 4,400+ pre-defined OIDs from Zabbix templates
  • Network Discovery - Automatic device discovery on network ranges
  • Network Tools - Traceroute, DNS lookup, port scanning, WHOIS, and more
  • Alert Engine - Rule-based alerting with multiple notification channels
  • IPAM Integration - View and manage IP address space (via ThothOS)
  • Modern Web UI - htmx-based dashboard with dark/light theme support
  • REST API - Full-featured API for automation and integration
  • SQLite Database - Zero-configuration embedded database

OID Template Library

Network Monitor includes a comprehensive OID template library based on Zabbix's open-source SNMP templates. Credit to the Zabbix team for maintaining these excellent vendor templates.

Included Vendors (122 templates, 4,400+ OIDs)

  • Cisco - IOS, ASA, Catalyst 3750, Nexus 9000
  • MikroTik - RouterOS, CRS, CCR, hEX series (45+ models)
  • Juniper - JunOS, MX series
  • Fortinet - FortiGate firewalls
  • F5 - BIG-IP load balancers
  • HP/Aruba - ProCurve, HPN, H3C
  • Huawei - Enterprise switches
  • Ubiquiti - AirOS devices
  • Dell - Force S-Series
  • Arista - EOS switches
  • Zyxel - Managed switches (20+ models)
  • And many more...

Using the Template Library

  1. Navigate to Tools > OID Templates
  2. Click Load Template Library to browse vendors
  3. Select a vendor to see available templates
  4. Import individual OIDs or bulk import by vendor
  5. Imported OIDs sync to ThothOS (in integrated mode)

Architecture

┌──────────────────────────────────────────────────────────────┐
│           Central Server (network-monitor server)            │
│  ├── HTTP API & Web UI (port 8080)                          │
│  ├── SQLite Database (network-monitor.db)                   │
│  ├── ThothOS GraphQL Client (optional)                      │
│  ├── Node Registration & Heartbeat Management               │
│  └── Bandwidth Test Coordination                            │
└──────────────────────────────────────────────────────────────┘
                         ▲
                         │ HTTP/gRPC
         ┌───────────────┼───────────────┐
         │               │               │
┌────────▼─────┐  ┌──────▼──────┐  ┌─────▼───────┐
│  Node-Alpha  │  │  Node-Beta  │  │  Node-Gamma │
│  :50051      │  │  :50052     │  │  :50053     │
│  (gRPC)      │  │  (gRPC)     │  │  (gRPC)     │
└──────────────┘  └─────────────┘  └─────────────┘

Prerequisites

Quick Start

Step I: Install Go Runtime

Download and install Go 1.21+ from https://go.dev/dl/

Step II: Download Network Monitor

Open PowerShell and run:

Invoke-WebRequest -Uri "https://github.com/Technologies-Unlimited/Network-Monitor/archive/refs/heads/production.zip" -OutFile "Network-Monitor.zip"

Step III: Extract the Archive

Expand-Archive -Path Network-Monitor.zip -DestinationPath .

Step IV: Build the Application

cd Network-Monitor-production
go build -o network-monitor.exe .

Step V: Start the Server

.\network-monitor.exe server

The server will start on http://localhost:8080

Step VI: Configure Settings

Open http://localhost:8080/settings in your browser to:

  • Connect to ThothOS (optional) - Enter your API key and proxy name
  • Select your preferred theme (Dark, Light, or Sacred)

Starting Monitoring Nodes (Optional)

To enable distributed monitoring, start additional nodes:

# Start first node
.\network-monitor.exe node --name Node-Alpha --grpc-port 50051

# Start second node (in another terminal)
.\network-monitor.exe node --name Node-Beta --grpc-port 50052

CLI Usage

Network Monitor uses a unified binary with subcommands:

# Start the central server
./network-monitor.exe server [options]

# Server options:
#   -p, --port        HTTP port to listen on (default: 8080)

# Start a monitoring node
./network-monitor.exe node --name <name> [options]

# Node options:
#   -n, --name        Node name (required, must be unique)
#   -p, --grpc-port   gRPC port for peer connections (default: 50051)
#   -s, --server      Central server address (default: http://localhost:8080)
#   -c, --company     Company ID (default: default)

Web UI Navigation

The web interface includes the following sections:

Page Description
Dashboard Overview with device counts, status, and active alerts
Devices Manage monitored network devices (routers, switches, servers)
Alerts View and manage active and historical alerts
Nodes Distributed monitoring nodes, peer connections, and bandwidth tests
Visualize Network topology and metrics visualization
Tools Network diagnostic tools and OID template library
IPAM IP address management (requires ThothOS)
Monitor SNMP/ICMP template configuration (requires ThothOS)
Reports Generate device, uptime, alert, and performance reports
Settings Theme settings and ThothOS connection configuration

Network Tools

The Tools page provides 14 network diagnostic utilities:

Tool Description
Traceroute Trace the network path to a destination
DNS Lookup Query DNS records (A, AAAA, MX, TXT, etc.)
Port Scan Scan for open ports on a target host
WHOIS Look up domain registration information
Bandwidth Test Test network throughput to external servers
Ping ICMP ping with statistics
MIB Browser Query SNMP OIDs with GET/GETNEXT/WALK (SNMPv1/v2c/v3)
MAC Lookup Look up vendor information from MAC addresses
Connection Test Test TCP/UDP connectivity to a host:port
HTTP Test Test HTTP/HTTPS endpoints with response details
SSL Check Validate SSL certificates and expiration
ARP Scan Discover devices on the local network
MTU Discovery Find the maximum transmission unit for a path
OID Templates Browse and import Zabbix SNMP templates

ThothOS Integration

Connecting to ThothOS

  1. Navigate to Settings
  2. Enter your ThothOS URL and API key
  3. Click Test Connection to verify
  4. Click Connect to establish the link

Synced Data

When connected to ThothOS, the following data is synchronized:

Data Type Direction Description
SNMP Templates ThothOS → Local SNMPv2/v3 polling templates
ICMP Templates ThothOS → Local Ping monitoring templates
OIDs Bidirectional SNMP object identifiers
IPAM Data ThothOS → Local Supernets, subnets, pools, VLANs, IPs
Device Status Local → ThothOS Heartbeat with device/node counts

API Key Permissions

ThothOS API keys support fine-grained permissions:

  • proxy:read/write - Proxy registration and management
  • snmp:read/write - SNMP template and OID management
  • icmp:read/write - ICMP template management
  • ipam:read/write - IP address management
  • config:read/write - Configuration synchronization
  • webhook:register - Webhook registration for real-time updates

Distributed Bandwidth Testing

High-Performance Testing

Bandwidth tests between nodes use 6 parallel gRPC bidirectional streams:

  • Achieves 10+ Gbps on capable hardware
  • Each stream sends/receives 4MB chunks
  • Real-time latency sampling for time-series charts

Network Path Modes

Tests support three network path modes:

Mode Description
Direct Connect directly to target node's IP (default)
Local Force traffic through localhost/loopback (127.0.0.1)
Gateway Route through a specified gateway address

Running a Bandwidth Test

  1. Navigate to Nodes page
  2. Ensure at least 2 nodes are online
  3. Create a peer connection between nodes
  4. Click Run Test and select:
    • Source and target nodes
    • Test type (bidirectional, upload, download)
    • Network path mode
    • Duration (5-300 seconds)

Node Management

Node Registration

  • Nodes register with the server on startup using their unique name
  • If a node with the same name exists, the existing record is updated
  • Node status is tracked via heartbeats (every 30 seconds)

Node Status Lifecycle

Status Condition
Online Actively sending heartbeats
Offline No heartbeat for 5+ minutes
Deleted Automatically removed after 15+ minutes without heartbeat

Configuration

Zero-Configuration Setup

Network Monitor requires no configuration files and no environment variables. All settings are managed through the Settings UI and stored in the SQLite database.

Simply start the server and configure everything through the web interface:

# Start on default port 8080
./network-monitor.exe server

# Start on custom port
./network-monitor.exe server --port 9000

# Open http://localhost:8080/settings to configure ThothOS connection

Settings Page

All configuration is managed through the Settings page at http://localhost:8080/settings:

ThothOS Integration

  • API Key - Your ThothOS API key (starts with tk_)
  • Proxy Name - A friendly name for this proxy instance (optional, defaults to hostname)
  • Test Connection - Validate your API key before connecting
  • Connect/Disconnect - Enable or disable ThothOS integration

Theme Selection

Choose from three visual themes:

  • Dark - Modern dark theme with blue accents (default)
  • Light - Clean light theme for well-lit environments
  • Sacred - Elegant dark theme with gold accents

All settings are automatically persisted to the SQLite database.

API Examples

List Zabbix Templates

curl http://localhost:8080/api/v1/zabbix-templates
# Returns: {"totalOids":4424,"totalTemplates":122,"vendors":[...]}

Import OIDs from Templates

# Import specific OIDs
curl -X POST http://localhost:8080/api/v1/zabbix-templates/import \
  -H "Content-Type: application/json" \
  -d '{"oids": [{"oid": "1.3.6.1.2.1.1.1.0", "name": "sysDescr", ...}]}'

# Import all OIDs from all templates
curl -X POST http://localhost:8080/api/v1/zabbix-templates/import-all

List Nodes

curl http://localhost:8080/api/v1/nodes

Start Bandwidth Test

curl -X POST http://localhost:8080/api/v1/bandwidth-tests/start \
  -H "Content-Type: application/json" \
  -d '{
    "source_node_id": "uuid-1",
    "target_node_id": "uuid-2",
    "test_type": "bidirectional",
    "duration": 10,
    "test_mode": "direct"
  }'

Add a Device

curl -X POST http://localhost:8080/api/v1/devices \
  -H "Content-Type: application/json" \
  -d '{
    "hostname": "router-1",
    "ip_address": "192.168.1.1",
    "device_type": "router",
    "icmp_enabled": true
  }'

Project Structure

Network-Monitor/
├── main.go                  # Unified CLI entry point (server + node)
├── internal/
│   ├── api/                 # HTTP API handlers
│   ├── database/            # SQLite database initialization
│   ├── grpc/                # gRPC server for node communication
│   │   └── pb/              # Generated protobuf files
│   ├── models/              # GORM data models
│   ├── middleware/          # Authentication middleware
│   ├── templates/           # Zabbix template parser
│   ├── thothos/             # ThothOS GraphQL client
│   └── server/              # Server state management
├── proto/
│   └── node/                # Protobuf definitions
├── templates/
│   └── snmp/                # Zabbix SNMP templates (122 vendors)
├── web/
│   ├── templates/           # HTML templates (htmx)
│   └── static/              # CSS, JS, images
└── network-monitor.db       # SQLite database (created at runtime)

Database Schema

Uses SQLite with GORM ORM. Key tables:

Table Description
nodes Registered monitoring nodes
node_peers Peer connections between nodes
bandwidth_test_results Historical bandwidth test results
scheduled_tests Scheduled/recurring bandwidth tests
devices Monitored network devices
alerts Active and historical alerts
alert_rules Alert rule definitions
snmp_templates SNMP polling templates
oids SNMP OID definitions (syncs with ThothOS)
settings Application settings (theme, ThothOS config)
proxy_configs ThothOS proxy registration data

Cross-Platform Builds

# Windows
go build -o network-monitor.exe .

# Linux
GOOS=linux GOARCH=amd64 go build -o network-monitor-linux .

# macOS (Apple Silicon)
GOOS=darwin GOARCH=arm64 go build -o network-monitor-macos .

# macOS (Intel)
GOOS=darwin GOARCH=amd64 go build -o network-monitor-macos-intel .

Performance

  • 10+ Gbps bandwidth testing between nodes
  • 100,000+ devices supported per server
  • Sub-second polling with raw ICMP sockets
  • ~100MB RAM base usage

Acknowledgments

  • Zabbix - For their excellent open-source SNMP templates which power our OID template library
  • Go Team - For creating a language that makes high-performance network tools accessible

License

MIT License - see LICENSE file

Contributing

Contributions welcome! Please open an issue or PR.


Built with Go | High-Performance Network Monitoring

About

High-performance network monitoring solution with distributed nodes, 10+ Gbps bandwidth testing, and comprehensive network tools. Built with Go.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages