Skip to content

RouterOS Monitoring with Grafana

Grafana is an open-source dashboarding platform that can visualize RouterOS metrics collected via SNMP. Two common collection pipelines are available:

PipelineBest For
Prometheus + SNMP ExporterExisting Prometheus infrastructure; metric scraping model
Telegraf + InfluxDBTime-series push model; simpler SNMP configuration

Both approaches require SNMP enabled on RouterOS and a Linux host to run the collection stack. The same Grafana instance can consume data from either backend.


Enable SNMP before configuring any Grafana pipeline. SNMPv2c is used in the examples below; SNMPv3 is strongly recommended for production — see SNMPv3 Configuration and Monitoring Integration for the full SNMPv3 setup.

# Enable SNMP
/snmp set enabled=yes contact="[email protected]" location="DC1-R1"
# Restrict community to the Grafana collector host
/snmp community set [find name=public] \
addresses=10.10.10.0/24 \
read-access=yes \
write-access=no
/snmp set enabled=yes contact="[email protected]" location="DC1-R1"
/snmp community add \
name=grafana \
security=private \
authentication-protocol=SHA1 \
authentication-password="AuthPass123!" \
encryption-protocol=AES \
encryption-password="PrivPass123!" \
addresses=10.10.10.10/32 \
read-access=yes \
write-access=no

Allow SNMP polling from the collector host only:

/ip firewall filter add \
chain=input protocol=udp dst-port=161 \
src-address=10.10.10.10/32 \
action=accept comment="SNMP polling from Grafana collector"
/ip firewall filter add \
chain=input protocol=udp dst-port=161 \
action=drop comment="Drop all other SNMP"

Approach 1: Prometheus + SNMP Exporter + Grafana

Section titled “Approach 1: Prometheus + SNMP Exporter + Grafana”
RouterOS ──(SNMP UDP 161)──► SNMP Exporter ──(HTTP :9116)──► Prometheus ──► Grafana

Prometheus scrapes the SNMP Exporter at a configured interval. The exporter translates SNMP OID values into Prometheus metrics. Grafana queries Prometheus to render dashboards.

Download the latest release from the Prometheus GitHub releases page and extract to a system directory:

Terminal window
# Create a dedicated user
sudo useradd --no-create-home --shell /bin/false snmp_exporter
# Download and extract (check https://github.com/prometheus/snmp_exporter/releases for latest)
wget https://github.com/prometheus/snmp_exporter/releases/download/v0.26.0/snmp_exporter-0.26.0.linux-amd64.tar.gz
tar xzf snmp_exporter-0.26.0.linux-amd64.tar.gz
sudo mv snmp_exporter-0.26.0.linux-amd64/snmp_exporter /usr/local/bin/
sudo chown snmp_exporter:snmp_exporter /usr/local/bin/snmp_exporter

Create /etc/snmp_exporter/snmp.yml with a MikroTik module. The following covers the most useful metrics:

/etc/snmp_exporter/snmp.yml
auths:
public_v2:
community: public
security_level: noAuthNoPriv
auth_protocol: MD5
priv_protocol: DES
version: 2
grafana_v3:
security_level: authPriv
username: grafana
password: AuthPass123!
auth_protocol: SHA
priv_protocol: AES
priv_password: PrivPass123!
version: 3
modules:
mikrotik:
walk:
- 1.3.6.1.2.1.1 # System info (sysDescr, sysUpTime, sysName)
- 1.3.6.1.2.1.2.2 # Interface table (ifDescr, ifOperStatus, ifSpeed)
- 1.3.6.1.2.1.31.1.1 # IF-MIB extended (64-bit counters, ifAlias)
- 1.3.6.1.4.1.14988.1.1.1 # MikroTik wireless (signal, noise, CCQ)
- 1.3.6.1.4.1.14988.1.1.3 # MikroTik health (voltage, temperature)
- 1.3.6.1.4.1.14988.1.1.7 # MikroTik CPU usage
- 1.3.6.1.4.1.14988.1.1.8 # MikroTik memory usage
metrics:
- name: sysUpTime
oid: 1.3.6.1.2.1.1.3.0
type: gauge
help: System uptime in hundredths of a second
- name: ifHCInOctets
oid: 1.3.6.1.2.1.31.1.1.1.6
type: counter
help: Inbound octets (64-bit)
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels: [ifIndex]
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifHCOutOctets
oid: 1.3.6.1.2.1.31.1.1.1.10
type: counter
help: Outbound octets (64-bit)
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels: [ifIndex]
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString
- name: ifOperStatus
oid: 1.3.6.1.2.1.2.2.1.8
type: gauge
help: Interface operational status (1=up, 2=down)
indexes:
- labelname: ifIndex
type: gauge
lookups:
- labels: [ifIndex]
labelname: ifName
oid: 1.3.6.1.2.1.31.1.1.1.1
type: DisplayString

Create /etc/systemd/system/snmp_exporter.service:

[Unit]
Description=Prometheus SNMP Exporter
After=network.target
[Service]
User=snmp_exporter
ExecStart=/usr/local/bin/snmp_exporter --config.file=/etc/snmp_exporter/snmp.yml
Restart=on-failure
[Install]
WantedBy=multi-user.target
Terminal window
sudo systemctl daemon-reload
sudo systemctl enable --now snmp_exporter
# Verify
curl http://localhost:9116/metrics | head -20

Add a scrape job to /etc/prometheus/prometheus.yml:

scrape_configs:
- job_name: mikrotik_snmp
static_configs:
- targets:
- 192.168.1.1 # Router IP
- 192.168.1.2 # Additional routers
metrics_path: /snmp
params:
module: [mikrotik]
auth: [public_v2] # or grafana_v3 for SNMPv3
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: localhost:9116 # SNMP Exporter address

Reload Prometheus:

Terminal window
sudo systemctl reload prometheus

Verify targets are up in the Prometheus UI at http://prometheus-host:9090/targets.

  1. In Grafana, navigate to Connections → Data Sources → Add data source.
  2. Select Prometheus.
  3. Set the URL to your Prometheus server (e.g., http://localhost:9090).
  4. Click Save & Test.

Several community dashboards work well with RouterOS metrics via SNMP Exporter:

Dashboard IDDescription
10950MikroTik: traffic, uptime, CPU, memory (wide interface coverage)
14857MikroTik SNMP: interface bandwidth with 64-bit counters

To import: Dashboards → New → Import, enter the dashboard ID, select the Prometheus datasource, and click Import.


RouterOS ──(SNMP UDP 161)──► Telegraf ──(HTTP API)──► InfluxDB ──► Grafana

Telegraf polls RouterOS directly via SNMP and writes results to InfluxDB. Grafana queries InfluxDB using Flux or InfluxQL.

Terminal window
# Debian/Ubuntu
wget -q https://repos.influxdata.com/influxdb.key -O- | sudo apt-key add -
echo "deb https://repos.influxdata.com/ubuntu focal stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt-get update && sudo apt-get install -y telegraf

Add to /etc/telegraf/telegraf.d/mikrotik.conf:

/etc/telegraf/telegraf.d/mikrotik.conf
[[inputs.snmp]]
## Target routers
agents = ["udp://192.168.1.1:161", "udp://192.168.1.2:161"]
## SNMPv2c
version = 2
community = "public"
## SNMPv3 (uncomment to use instead)
# version = 3
# sec_name = "grafana"
# auth_protocol = "SHA"
# auth_password = "AuthPass123!"
# priv_protocol = "AES"
# priv_password = "PrivPass123!"
# sec_level = "authPriv"
## Polling interval
interval = "60s"
timeout = "10s"
retries = 3
## System info
[[inputs.snmp.field]]
name = "hostname"
oid = "RFC1213-MIB::sysName.0"
is_tag = true
[[inputs.snmp.field]]
name = "uptime"
oid = "DISMAN-EXPRESSION-MIB::sysUpTimeInstance"
## CPU usage (MikroTik enterprise OID)
[[inputs.snmp.field]]
name = "cpu_usage"
oid = "1.3.6.1.4.1.14988.1.1.7.1.0"
## Memory (MikroTik enterprise OID)
[[inputs.snmp.field]]
name = "mem_total"
oid = "1.3.6.1.4.1.14988.1.1.8.1.0"
[[inputs.snmp.field]]
name = "mem_used"
oid = "1.3.6.1.4.1.14988.1.1.8.2.0"
## Interface traffic (64-bit counters, one row per interface)
[[inputs.snmp.table]]
name = "interface_traffic"
inherit_tags = ["hostname"]
oid = "IF-MIB::ifXTable"
[[inputs.snmp.table.field]]
name = "name"
oid = "IF-MIB::ifName"
is_tag = true
[[inputs.snmp.table.field]]
name = "in_octets"
oid = "IF-MIB::ifHCInOctets"
[[inputs.snmp.table.field]]
name = "out_octets"
oid = "IF-MIB::ifHCOutOctets"
[[inputs.snmp.table.field]]
name = "in_errors"
oid = "IF-MIB::ifInErrors"
[[inputs.snmp.table.field]]
name = "out_errors"
oid = "IF-MIB::ifOutErrors"
[[inputs.snmp.table.field]]
name = "oper_status"
oid = "IF-MIB::ifOperStatus"

Configure Telegraf output to InfluxDB:

/etc/telegraf/telegraf.d/output.conf
[[outputs.influxdb_v2]]
urls = ["http://localhost:8086"]
token = "$INFLUX_TOKEN"
organization = "my-org"
bucket = "routeros"

Start Telegraf:

Terminal window
sudo systemctl enable --now telegraf
sudo journalctl -u telegraf -f # watch for errors
  1. Navigate to Connections → Data Sources → Add data source.
  2. Select InfluxDB.
  3. Set Query Language to Flux.
  4. Set URL to http://localhost:8086.
  5. Under InfluxDB Details: enter your Organization, Token, and default Bucket (routeros).
  6. Click Save & Test.

Interface bandwidth (bits per second):

from(bucket: "routeros")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "interface_traffic")
|> filter(fn: (r) => r._field == "in_octets" or r._field == "out_octets")
|> filter(fn: (r) => r.name == "ether1")
|> derivative(unit: 1s, nonNegative: true)
|> map(fn: (r) => ({r with _value: r._value * 8.0}))

CPU utilization:

from(bucket: "routeros")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "snmp" and r._field == "cpu_usage")

These OIDs are useful when building custom SNMP Exporter modules or Telegraf field configurations:

OIDNameDescription
1.3.6.1.2.1.1.3.0sysUpTimeUptime in hundredths of a second
1.3.6.1.2.1.2.2.1.8ifOperStatusInterface up (1) / down (2)
1.3.6.1.2.1.31.1.1.1.6ifHCInOctetsInbound bytes, 64-bit
1.3.6.1.2.1.31.1.1.1.10ifHCOutOctetsOutbound bytes, 64-bit
1.3.6.1.4.1.14988.1.1.1.1MikroTik wireless signal strengthPer-interface
1.3.6.1.4.1.14988.1.1.3.1.0MikroTik voltageBoard voltage
1.3.6.1.4.1.14988.1.1.3.10.0MikroTik temperatureBoard temperature (°C)
1.3.6.1.4.1.14988.1.1.7.1.0MikroTik CPU usageCPU load percentage
1.3.6.1.4.1.14988.1.1.8.1.0MikroTik total memoryBytes
1.3.6.1.4.1.14988.1.1.8.2.0MikroTik free memoryBytes

FactorPrometheus + SNMP ExporterTelegraf + InfluxDB
Scrape modelPull (Prometheus scrapes exporter)Push (Telegraf writes to InfluxDB)
Query languagePromQLFlux / InfluxQL
Existing stackWorks if Prometheus already presentWorks if InfluxDB already present
Configuration complexityHigher (snmp.yml module + Prometheus job)Moderate (single Telegraf config)
AlertingAlertmanager (well-established)InfluxDB Tasks or Grafana Alerts
Multi-device scalingExcellent (relabeling rules)Good (multiple agents entries)

  1. Confirm SNMP is reachable from the collector host:
    Terminal window
    snmpwalk -v2c -c public 192.168.1.1 1.3.6.1.2.1.1
  2. For Prometheus: check the SNMP Exporter’s own metrics endpoint:
    Terminal window
    curl "http://localhost:9116/snmp?target=192.168.1.1&module=mikrotik" | grep -v "^#"
  3. For Telegraf: check logs for connection errors:
    Terminal window
    sudo journalctl -u telegraf | grep -i error
  4. Verify no firewall rule is dropping UDP 161 on the router:
    /ip firewall filter print where dst-port=161
  • Confirm the OID returns numeric data:
    Terminal window
    snmpget -v2c -c public 192.168.1.1 1.3.6.1.2.1.31.1.1.1.6.1
  • Check that read-access=yes is set on the SNMP community.
  • Verify the IF-MIB walk is returning ifName data:
    Terminal window
    snmpwalk -v2c -c public 192.168.1.1 1.3.6.1.2.1.31.1.1.1.1