Skip to main content

Adding New Devices

Most prosumer to professional networking equipment utilizes SNMP in order to pull statistics (and in some cases, set configuration) into a centralized system such as LibreNMS or Grafana.

Our statistics stack for non-Ubiquiti equipment consists of Grafana, ingesting data from Prometheus, ingesting data from SNMP Exporter (it also has other modules, such as NUT Exporter for UPSes, Node Exporter for Linux boxes, etc.).

  • Server IP: 10.70.90.142
  • Prometheus: 10.70.90.142:9090
  • SNMP Exporter: 10.70.90.142:9116

In order to add new devices to the statistics stack, the device must be added to Prometheus for the records to be available for Grafana to be graphed.

Adding Devices to Prometheus for Existing Device Types

As described above, each of the component scraping services (not Grafana) lives on the same box. All of the services run as a systemd service. To access the server and the configurations:

  1. SSH into the Prometheus server (see above)
  2. cd into the /opt folder (where the binaries and configurations live)
  3. cd into the prometheus folder, and edit the prometheus.yml file.

In the file, there are several "scrape modules", which have specific parameters with a job_name. Each module has a static_configs section containing multiple targets, which is where new devices will be added.

For example, for Cambium 6GHz ePMP devices, you would add additional targets to its respective block:

  - job_name: 'snmp cambium_epmp'
    scrape_interval: 30s
    scrape_timeout: 20s
    static_configs:
      - targets: ["10.97.98.118"]
        labels:
          hostname: "nycmesh-1417-force6g-1340"
# the new target to be added
      - targets: ["10.12.34.56"]
        labels:
          hostname: "nycmesh-123456-newdevice"

Once the file is edited and saved, systemctl restart prometheus will restart the service, and after a couple of minutes, the Prometheus web interface will show the new target on its Targets page.

image.png

This device, and all of its parameters, will now be visible by its hostname label—much preferred than requiring a specific IP address to be referenced in Grafana.

image.png

Adding Custom MIBs to SNMP Exporter

root@nycmesh-713-02-prom1:~/snmp_exporter/generator# snmptranslate -mALL -L o | grep "Cannot find module"
Cannot find module (SNMPv2-SMI): At line 34 in /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
Cannot find module (HCNUM-TC): At line 37 in /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
Cannot find module (SNMPv2-TC): At line 40 in /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
Cannot find module (SNMPv2-TC): At line 7 in /usr/share/snmp/mibs/UCD-IPFWACC-MIB.txt
Cannot find module (SNMPv2-TC): At line 10 in /usr/share/snmp/mibs/UCD-DLMOD-MIB.txt
Cannot find module (SNMPv2-TC): At line 15 in /usr/share/snmp/mibs/UCD-DISKIO-MIB.txt
Cannot find module (SNMP-FRAMEWORK-MIB): At line 9 in /usr/share/snmp/mibs/NET-SNMP-VACM-MIB.txt
Cannot find module (SNMPv2-SMI): At line 8 in /usr/share/snmp/mibs/NET-SNMP-MIB.txt
Cannot find module (SNMP-VIEW-BASED-ACM-MIB): At line 16 in /usr/share/snmp/mibs/NET-SNMP-VACM-MIB.txt
Cannot find module (SNMPv2-TC): At line 25 in /usr/share/snmp/mibs/NET-SNMP-VACM-MIB.txt
Cannot find module (SNMP-FRAMEWORK-MIB): At line 10 in /usr/share/snmp/mibs/NET-SNMP-PASS-MIB.txt
Cannot find module (SNMP-FRAMEWORK-MIB): At line 10 in /usr/share/snmp/mibs/NET-SNMP-EXAMPLES-MIB.txt
Cannot find module (SNMPv2-TC): At line 12 in /usr/share/snmp/mibs/NET-SNMP-EXAMPLES-MIB.txt
Cannot find module (INET-ADDRESS-MIB): At line 13 in /usr/share/snmp/mibs/NET-SNMP-EXAMPLES-MIB.txt
Cannot find module (SNMP-FRAMEWORK-MIB): At line 9 in /usr/share/snmp/mibs/NET-SNMP-AGENT-MIB.txt
Cannot find module (SNMPv2-TC): At line 21 in /usr/share/snmp/mibs/NET-SNMP-AGENT-MIB.txt
Cannot find module (SNMPv2-TC): At line 15 in /usr/share/snmp/mibs/LM-SENSORS-MIB.txt
Cannot find module (SNMPv2-SMI): At line 8 in /root/.snmp/mibs/cambium-epmp-5.10.0-mib.txt
Cannot find module (SNMPv2-TC): At line 12 in /root/.snmp/mibs/cambium-epmp-5.10.0-mib.txt
Cannot find module (IPV6-TC): At line 14 in /root/.snmp/mibs/cambium-epmp-5.10.0-mib.txt