Tutorials · DevOps & Containers
How to Monitor Edge Servers and the Network With Prometheus and Grafana
Run a small monitoring stack in containers: node_exporter for the edge server, snmp_exporter for switches, Prometheus to store metrics and Grafana for dashboards and alerts.
Before you start
- Docker with compose on an edge server or VM
- SNMPv3 enabled on switches and gateways
- About 2 GB RAM and 20 GB disk
Step by step
Write the stack
Pin versions and keep data in volumes.
services: prometheus: image: prom/prometheus:v2.54.1 volumes: [./prometheus.yml:/etc/prometheus/prometheus.yml:ro, prom:/prometheus] ports: ["127.0.0.1:9090:9090"] restart: unless-stopped node: image: prom/node-exporter:v1.8.2 pid: host volumes: [/:/host:ro,rslave] command: [--path.rootfs=/host] restart: unless-stopped snmp: image: prom/snmp-exporter:v0.26.0 restart: unless-stopped grafana: image: grafana/grafana:11.2.0 ports: ["3000:3000"] volumes: [grafana:/var/lib/grafana] restart: unless-stopped volumes: { prom: {}, grafana: {} }
Tell Prometheus what to scrape
The edge server itself, plus each switch through the SNMP exporter.
# prometheus.yml scrape_configs: - job_name: edge static_configs: [{ targets: ["node:9100"] }] - job_name: switches metrics_path: /snmp params: { module: [if_mib] } static_configs: [{ targets: ["10.1.99.2", "10.1.99.3"] }] relabel_configs: - { source_labels: [__address__], target_label: __param_target } - { source_labels: [__param_target], target_label: instance } - { target_label: __address__, replacement: "snmp:9116" }
Start it
docker compose up -d && docker compose psAdd dashboards
In Grafana, add Prometheus (http://prometheus:9090) as a data source and import community dashboards for Node Exporter and SNMP interface traffic.
Alert on what matters
Start with a few alerts: edge server disk above 85%, a switch not answering, an uplink above 80% for 15 minutes.
Commands are generic, industry-standard examples. Exact syntax and menu names vary by model and firmware; check your device's manual on the Documentation page.
Pro tips
- Change Grafana's admin password on first login and put it behind HTTPS.
- NavCloud already monitors Navijin gateways, APs and switches; use this stack for edge servers, applications and third-party devices.
FAQ
Frequently asked questions
How long are metrics kept?
15 days by default. Set --storage.tsdb.retention.time to keep more, and size the disk to match.
Keep learning
Related guides
Monitor with SNMP and syslog
Read more →Docker Compose for edge applications
Read more →How to Use SSH Keys Instead of Passwords for Network Devices and Servers
Passwords can be guessed, phished and reused. Create an SSH key pair, install the public key on gateways, edge servers and Linux hosts, then turn password logins off.
Read more →How to Reach Remote Sites Safely With an SSH Jump Host
Do not expose SSH on every device. Put one hardened jump host (bastion) in front of the management network and reach everything else through it.
Read more →How to Open a Device Web Page Through an SSH Tunnel
Reach the web interface of a switch, NVR or container on a remote site without opening a firewall port: forward it through SSH.
Read more →Stuck on a step?
Ask Navijin technical support or an authorised partner for help with your configuration.