SNMP Monitoring for Homelab Network Devices
Most homelab monitoring focuses on servers — CPU, memory, disk, network interfaces. But switches, UPS units, APs, and other network hardware expose their own metrics via SNMP (Simple Network Management Protocol). With the Prometheus SNMP Exporter, you can pull switch port statistics, UPS battery status, AP client counts, and more into your existing Grafana dashboards.
Photo by lonely blue on Unsplash
What SNMP Exposes
Network devices expose metrics via OIDs (Object Identifiers) — a hierarchical numbering system for device attributes:
- Switch port traffic counters (in/out bytes, errors, discards)
- Interface status (up/down)
- CPU and memory utilization
- UPS battery percentage, estimated runtime, load
- Temperature sensors
- Fan speeds
SNMP versions:
- v1: Old, insecure, don't use
- v2c: Community string authentication (plain text, but acceptable on trusted LANs)
- v3: Authenticated and encrypted. Use for anything sensitive.
For homelab on a trusted internal network, SNMPv2c is common and simple to configure.
Enable SNMP on Common Devices
Mikrotik Switches
/snmp
set enabled=yes contact="admin@local" location="homelab" trap-version=2
/snmp community
set [ find default=yes ] name=public read-access=yes
Or via Winbox/WebFig: IP → SNMP → Enable, set community name.
Ubiquiti UniFi
In the UniFi controller: Settings → System → SNMP → Enable.
Community: public (default, change if desired)
SNMP version: v2c or v3
Cisco/Catalyst switches
snmp-server community public RO
snmp-server location homelab
snmp-server contact admin
APC UPS (Network Management Card)
The APC NMC exposes extensive UPS metrics via SNMP. Access via the card's web interface: Administration → Network → SNMP → Enable.
TrueNAS
System → SNMP → Enable. Set community string and location.
Synology NAS
Control Panel → Terminal & SNMP → SNMP → Enable.
Verify SNMP Is Working
From your monitoring server:
# Install snmpwalk
sudo apt install snmp snmp-mibs-downloader
# Test: walk the device's MIB tree
snmpwalk -v2c -c public 192.168.1.1
# Get a specific OID (system description)
snmpget -v2c -c public 192.168.1.1 1.3.6.1.2.1.1.1.0
# Walk interface table
snmpwalk -v2c -c public 192.168.1.1 1.3.6.1.2.1.2.2
If you get output, SNMP is working.
Prometheus SNMP Exporter
The SNMP Exporter converts SNMP OIDs to Prometheus metrics:
# docker-compose.yml
services:
snmp_exporter:
image: prom/snmp-exporter:latest
container_name: snmp_exporter
restart: unless-stopped
ports:
- 9116:9116
volumes:
- ./snmp.yml:/etc/snmp_exporter/snmp.yml
The snmp.yml configuration file maps OIDs to metric names. Pre-built configurations exist for common vendors.
Download pre-built configs
The SNMP Exporter generator creates vendor-specific configs. The snmp_exporter GitHub repository includes configs for:
if_mib: Standard interface statistics (works on any device)apcups: APC UPS metricsmikrotik: Mikrotik-specific metricssynology: Synology NAS metrics
# Download the generator output for common MIBs
curl -o snmp.yml https://raw.githubusercontent.com/prometheus/snmp_exporter/main/snmp.yml
The default snmp.yml is quite large — consider using the generator to create a minimal config for just your devices.
Prometheus Configuration
# prometheus.yml scrape config
scrape_configs:
- job_name: "snmp_switches"
static_configs:
- targets:
- 192.168.1.1 # Mikrotik switch
- 192.168.1.2 # Another switch
metrics_path: /snmp
params:
auth: [public_v2] # Authentication profile from snmp.yml
module: [if_mib] # Which MIB module to use
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: snmp_exporter:9116
- job_name: "snmp_ups"
static_configs:
- targets:
- 192.168.1.50 # APC UPS
metrics_path: /snmp
params:
auth: [public_v2]
module: [apcups]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: snmp_exporter:9116
Key Metrics to Dashboard
Switch port throughput
# Inbound traffic rate per port (bytes/sec)
rate(ifInOctets{job="snmp_switches"}[5m]) * 8 # bits/sec
# Total network traffic across all ports
sum(rate(ifOutOctets{job="snmp_switches"}[5m])) by (ifName)
Interface errors
# Error rate on switch ports
rate(ifInErrors{job="snmp_switches"}[5m])
UPS battery
# APC UPS battery capacity %
upsAdvBatteryCapacity{job="snmp_ups"}
# Estimated runtime (minutes)
upsAdvBatteryRunTimeRemaining{job="snmp_ups"} / 6000
# UPS load %
upsAdvOutputLoad{job="snmp_ups"}
Grafana Dashboard
The Grafana dashboard library has pre-built SNMP dashboards:
- Dashboard ID 1124: Network Interface
- Dashboard ID 9526: APC UPS
- Dashboard ID 14719: Mikrotik
Import them: Dashboards → Import → Enter ID.
LibreNMS Alternative
If you prefer a dedicated network monitoring tool over Prometheus/Grafana, LibreNMS is a self-hosted alternative:
services:
librenms:
image: librenms/librenms:latest
container_name: librenms
ports:
- 8000:8000
environment:
DB_HOST: librenms-db
DB_NAME: librenms
DB_USER: librenms
DB_PASSWORD: changeme
APP_KEY: base64:random-key
LibreNMS auto-discovers devices via SNMP, generates graphs, sends alerts, and includes pre-built dashboards for hundreds of device types.
Alerting
With Prometheus AlertManager, alert on SNMP metrics:
# alerts.yml
groups:
- name: network
rules:
- alert: SwitchPortHighErrors
expr: rate(ifInErrors[5m]) > 10
for: 5m
annotations:
summary: "High error rate on {{ $labels.ifName }}"
- alert: UPSBatteryLow
expr: upsAdvBatteryCapacity < 30
for: 2m
annotations:
summary: "UPS battery at {{ $value }}%"
SNMP monitoring rounds out a homelab observability stack — once you have switch port utilization and UPS status in Grafana alongside your server metrics, you have a complete picture of your infrastructure health.
