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.

Intermediate20 min5 steps

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

  1. 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: {} }
    
  2. 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" }
    
  3. Start it

    docker compose up -d && docker compose ps
    
  4. Add dashboards

    In Grafana, add Prometheus (http://prometheus:9090) as a data source and import community dashboards for Node Exporter and SNMP interface traffic.

  5. 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.