# Network Monitoring Stack

> Complete network monitoring with LibreNMS, Oxidized config backup, and Smokeping

- Category: Monitoring & Observability
- Difficulty: intermediate
- Components: librenms, oxidized, smokeping, mariadb, redis
- Tags: librenms, snmp, network, oxidized, smokeping, monitoring
- Source: https://docker.recipes/monitoring/network-monitoring-stack

## Overview

LibreNMS is a comprehensive open-source network monitoring platform that auto-discovers devices via SNMP and provides detailed performance metrics, alerting, and network visualization. Originally forked from Observium in 2013, LibreNMS has evolved into a community-driven solution supporting thousands of device types from major vendors like Cisco, Juniper, HP, and Dell. The platform excels at monitoring network infrastructure through SNMP polling, providing bandwidth utilization graphs, port status monitoring, and device health tracking.

This monitoring stack combines LibreNMS's network discovery capabilities with Oxidized for automated configuration backup and Smokeping for latency monitoring. Oxidized connects to network devices via SSH/Telnet to regularly backup configurations and track changes over time, while Smokeping measures network latency and packet loss through continuous ping monitoring. MariaDB serves as LibreNMS's primary database for storing device information, performance metrics, and historical data, while Redis handles caching and job queuing for the LibreNMS dispatcher service.

Network administrators managing enterprise infrastructure, MSPs monitoring client networks, and homelab enthusiasts tracking personal networks will find this stack invaluable. The combination provides complete visibility into network performance, automated change tracking for compliance, and proactive latency monitoring to identify connectivity issues before they impact users. Unlike standalone monitoring tools, this integrated approach correlates device performance with configuration changes and network latency patterns.

## Features

- Auto-discovery of network devices via SNMP with support for 3000+ device types including Cisco, Juniper, HP, and Mikrotik
- Real-time bandwidth monitoring with customizable alerting thresholds for interface utilization and error rates
- Automated configuration backup through Oxidized with Git-based version control and change detection
- Continuous latency monitoring via Smokeping with multi-target ping graphs and packet loss tracking
- LibreNMS dispatcher service for distributed polling across multiple nodes to handle large network infrastructures
- Integration between LibreNMS and Oxidized for centralized device management and configuration correlation
- Weathermap plugin support for creating visual network topology diagrams with real-time link utilization
- Custom OID monitoring for proprietary SNMP metrics and vendor-specific device parameters

## Use cases

- Enterprise network monitoring for tracking switch port utilization, router performance, and firewall throughput across multiple sites
- MSP client network management with automated configuration backups for compliance and change tracking
- Data center infrastructure monitoring including server hardware, UPS systems, and environmental sensors
- ISP network operations for monitoring core routers, edge devices, and customer connection quality
- Campus network administration tracking wireless access points, distribution switches, and core infrastructure
- Homelab network monitoring for enthusiasts running complex home networks with VLANs and multiple subnets
- DevOps network visibility for monitoring cloud infrastructure, VPN concentrators, and hybrid connectivity

## Prerequisites

- Docker host with minimum 4GB RAM (LibreNMS requires 2GB+, MariaDB needs 1GB+, additional overhead for other services)
- Network devices with SNMP v1/v2c/v3 enabled and proper community strings or authentication credentials configured
- TCP ports 8000, 8081, and 8888 available for LibreNMS, Smokeping, and Oxidized web interfaces respectively
- SSH/Telnet access credentials for network devices if using Oxidized configuration backup functionality
- Understanding of SNMP concepts, OIDs, and network device management for proper monitoring configuration
- Firewall rules allowing SNMP (UDP 161) and ICMP traffic from Docker host to monitored network devices

## docker-compose.yml

```yaml
services:
  librenms:
    image: librenms/librenms:latest
    container_name: librenms
    restart: unless-stopped
    ports:
      - "${LIBRENMS_PORT:-8000}:8000"
    environment:
      - TZ=${TZ:-UTC}
      - PUID=${PUID:-1000}
      - PGID=${PGID:-1000}
      - DB_HOST=librenms-db
      - DB_NAME=librenms
      - DB_USER=librenms
      - DB_PASSWORD=${DB_PASSWORD}
      - REDIS_HOST=librenms-redis
    volumes:
      - librenms_data:/data
    depends_on:
      - librenms-db
      - librenms-redis

  librenms-dispatcher:
    image: librenms/librenms:latest
    container_name: librenms-dispatcher
    restart: unless-stopped
    environment:
      - TZ=${TZ:-UTC}
      - PUID=${PUID:-1000}
      - PGID=${PGID:-1000}
      - DB_HOST=librenms-db
      - DB_NAME=librenms
      - DB_USER=librenms
      - DB_PASSWORD=${DB_PASSWORD}
      - REDIS_HOST=librenms-redis
      - SIDECAR_DISPATCHER=1
    volumes:
      - librenms_data:/data
    depends_on:
      - librenms

  librenms-db:
    image: mariadb:10.11
    container_name: librenms-db
    restart: unless-stopped
    environment:
      - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
      - MYSQL_DATABASE=librenms
      - MYSQL_USER=librenms
      - MYSQL_PASSWORD=${DB_PASSWORD}
    volumes:
      - librenms_db_data:/var/lib/mysql

  librenms-redis:
    image: redis:7-alpine
    container_name: librenms-redis
    restart: unless-stopped

  oxidized:
    image: oxidized/oxidized:latest
    container_name: oxidized
    restart: unless-stopped
    ports:
      - "${OXIDIZED_PORT:-8888}:8888"
    volumes:
      - ./oxidized:/home/oxidized/.config/oxidized
    depends_on:
      - librenms

  smokeping:
    image: lscr.io/linuxserver/smokeping:latest
    container_name: smokeping
    restart: unless-stopped
    ports:
      - "${SMOKEPING_PORT:-8081}:80"
    environment:
      - PUID=${PUID:-1000}
      - PGID=${PGID:-1000}
      - TZ=${TZ:-UTC}
    volumes:
      - ./smokeping/config:/config
      - smokeping_data:/data

volumes:
  librenms_data:
  librenms_db_data:
  smokeping_data:
```

## .env

```bash
# Network Monitoring Stack
LIBRENMS_PORT=8000
OXIDIZED_PORT=8888
SMOKEPING_PORT=8081

# Database
DB_PASSWORD=librenms_password
DB_ROOT_PASSWORD=root_password

# User/Group
PUID=1000
PGID=1000
TZ=UTC
```

## Usage notes

- LibreNMS at http://localhost:8000
- Smokeping (latency graphs) at http://localhost:8081
- Oxidized (config backup) at http://localhost:8888
- Add network devices in LibreNMS via SNMP
- Configure Oxidized to backup device configs
- LibreNMS auto-discovers devices on the network

## Troubleshooting

- SNMP timeout errors during device discovery: Verify SNMP community strings, check firewall rules allowing UDP 161, and ensure devices have SNMP enabled
- LibreNMS shows 'DB connection failed': Wait for MariaDB container to fully initialize (can take 2-3 minutes on first run), check DB_PASSWORD environment variable matches
- Oxidized failing to backup configurations: Verify SSH/Telnet credentials in oxidized config, ensure devices allow management connections from Docker host IP
- Smokeping graphs not generating data: Check ICMP is not blocked by host firewall, verify target hosts in smokeping config are reachable via ping
- LibreNMS dispatcher not processing jobs: Restart librenms-dispatcher container, check Redis connectivity, verify proper file permissions on librenms_data volume
- Web interface loading slowly or timing out: Increase PHP memory limits in LibreNMS container, check if polling intervals are too aggressive for network size

