RouterOS monitoring: mktxp exporter for rb5009-a/b + crs309, retire ER-X SNMP probe #139

Closed
opened 2026-11-17 18:58:35 +00:00 by ginjiruu · 3 comments
Owner

Part of #43.

Problem

Since the ER-X swap there is no working router monitoring. flux-clusters/clusters/mini/monitoring/resources/scrapes/router-scrape.yaml (and the portable copy) still probe 10.15.1.1 with the ubnt_router SNMP module. That address is now the RB5009 VRRP address, the routeros roots configure no SNMP, and RouterOS lacks most of the UCD-SNMP tables that module walks. Not yet checked in VictoriaMetrics whether the probe returns errors or partial data.

Proposal

Deploy akpw/mktxp (RouterOS API exporter, Python, GPL-2) on mini, one entry per device: rb5009-a, rb5009-b, crs309. Scrape all three individually (not the VRRP address, which hides which router answered).

Router side (iac, routeros roots):

  • read-only group + monitoring user per device (policy read,api only; api-ssl service, address-restricted to mini's addresses). Mind the 7.25 findings: service= on groups is a no-op, the policy set is the gate.
  • api-ssl bound to the OpenBao www-ssl leaf (ADR-0009), so the exporter verifies with the lab root CA (ssl_ca_file), no ssl_certificate_verify=False.
  • password in OpenBao secret/routeros-secrets, ESO-synced as one secret per device, mounted as mktxp's credentials_file YAML (keeps secrets out of mktxp.conf).

Cluster side (flux-clusters):

  • Deployment + Service + VMServiceScrape in clusters/mini/monitoring, image pinned.
  • delete the ubnt_router VMProbe (mini + portable) and the SNMP module once the new scrape has data.

Collectors worth turning on

  • firewall with matching-only off: by default mktxp drops rules with 0 bytes (datasource/firewall_ds.py), so "catch-all drop stopped counting" or "rule never fires" can't be alerted on. Series are labelled by comment, so our [tf:<key>] comments become stable rule identities (#67 convention).
  • bgp + routing_stats: session state to the Cilium peers, plus advertised-prefix counts per peer (count-only on /routing/bgp/advertisements). For #125, alert if advertised count to a Cilium peer is ever non-zero.
  • netwatch: the rollback fuse's probes (#74), and VRRP failover visibility for #128.
  • health, monitor (SFP DDM where the optics report it), poe, interface, public_ip (PPPoE IP changes on failover), dhcp (leases live on the VRRP master only: scrape both, join on MAC), certificate (www-ssl leaf expiry as a backstop to the renewal path), routerboard + package (firmware/upgrade pending, feeds #71).

Done when

  • three routers scraped over api-ssl with a verified cert, user read-only
  • a dashboard or at least alerts for: device down, BGP session down, advertised prefixes to Cilium > 0, firewall catch-all drop counter flat for N hours, PSU/temperature out of range, cert < 14 days
  • old SNMP probe removed

Pattern review that led here: docs/routeros/notes/2026-11-17-mktxp-patterns.md §7 (PR #134).

Part of #43. ## Problem Since the ER-X swap there is no working router monitoring. `flux-clusters/clusters/mini/monitoring/resources/scrapes/router-scrape.yaml` (and the `portable` copy) still probe `10.15.1.1` with the `ubnt_router` SNMP module. That address is now the RB5009 VRRP address, the routeros roots configure no SNMP, and RouterOS lacks most of the UCD-SNMP tables that module walks. Not yet checked in VictoriaMetrics whether the probe returns errors or partial data. ## Proposal Deploy akpw/mktxp (RouterOS API exporter, Python, GPL-2) on mini, one entry per device: rb5009-a, rb5009-b, crs309. Scrape all three individually (not the VRRP address, which hides which router answered). Router side (iac, routeros roots): - read-only group + `monitoring` user per device (policy `read,api` only; `api-ssl` service, address-restricted to mini's addresses). Mind the 7.25 findings: `service=` on groups is a no-op, the policy set is the gate. - `api-ssl` bound to the OpenBao www-ssl leaf (ADR-0009), so the exporter verifies with the lab root CA (`ssl_ca_file`), no `ssl_certificate_verify=False`. - password in OpenBao `secret/routeros-secrets`, ESO-synced as one secret per device, mounted as mktxp's `credentials_file` YAML (keeps secrets out of `mktxp.conf`). Cluster side (flux-clusters): - Deployment + Service + VMServiceScrape in `clusters/mini/monitoring`, image pinned. - delete the `ubnt_router` VMProbe (mini + portable) and the SNMP module once the new scrape has data. ## Collectors worth turning on - `firewall` with matching-only off: by default mktxp drops rules with 0 bytes (`datasource/firewall_ds.py`), so "catch-all drop stopped counting" or "rule never fires" can't be alerted on. Series are labelled by comment, so our `[tf:<key>]` comments become stable rule identities (#67 convention). - `bgp` + `routing_stats`: session state to the Cilium peers, plus advertised-prefix counts per peer (`count-only` on `/routing/bgp/advertisements`). For #125, alert if advertised count to a Cilium peer is ever non-zero. - `netwatch`: the rollback fuse's probes (#74), and VRRP failover visibility for #128. - `health`, `monitor` (SFP DDM where the optics report it), `poe`, `interface`, `public_ip` (PPPoE IP changes on failover), `dhcp` (leases live on the VRRP master only: scrape both, join on MAC), `certificate` (www-ssl leaf expiry as a backstop to the renewal path), `routerboard` + `package` (firmware/upgrade pending, feeds #71). ## Done when - three routers scraped over api-ssl with a verified cert, user read-only - a dashboard or at least alerts for: device down, BGP session down, advertised prefixes to Cilium > 0, firewall catch-all drop counter flat for N hours, PSU/temperature out of range, cert < 14 days - old SNMP probe removed Pattern review that led here: `docs/routeros/notes/2026-11-17-mktxp-patterns.md` §7 (PR #134).
Author
Owner

Cluster scaffold: lab/clusters#1715 (draft). Merge only after the router side exists: monitoring user, api-ssl bound to the OpenBao leaf, *_MONITORING_PASSWORD keys in secret/routeros-secrets. mktxp 2.1.0 hard-codes firewall matching-only (zero-byte rules emit no series), so the 'catch-all drop counter flat' alert needs an upstream option or a patch.

Cluster scaffold: lab/clusters#1715 (draft). Merge only after the router side exists: monitoring user, api-ssl bound to the OpenBao leaf, *_MONITORING_PASSWORD keys in secret/routeros-secrets. mktxp 2.1.0 hard-codes firewall matching-only (zero-byte rules emit no series), so the 'catch-all drop counter flat' alert needs an upstream option or a patch.
Author
Owner

Live 2026-11-17. mktxp on mini scrapes rb5009-a, rb5009-b and crs309 over api-ssl with verified TLS (vmagent job mini-mktxp up, ~2100 samples). Router side: iac#143 (two-slot users monitoring-a/-b, read,api only, from 10.44.0.0/16; Terraform writes OpenBao, then the router, then active; ADR-0011). Provider fork 1.99.1004 (password_wo). Cluster side: clusters#1715 (exporter, old ER-X SNMP probe removed), #1717, #1720, #1721. Rollout: router objects suspended, openbao-config applied the policies first, then rb5009-b, rb5009-a, crs309 one at a time; no fuse left armed. Remaining for done-when: alerts and dashboards; firewall zero-byte rules still emit no series (mktxp 2.1.0 hard-codes matching-only).

Live 2026-11-17. mktxp on mini scrapes rb5009-a, rb5009-b and crs309 over api-ssl with verified TLS (vmagent job mini-mktxp up, ~2100 samples). Router side: iac#143 (two-slot users monitoring-a/-b, read,api only, from 10.44.0.0/16; Terraform writes OpenBao, then the router, then active; ADR-0011). Provider fork 1.99.1004 (password_wo). Cluster side: clusters#1715 (exporter, old ER-X SNMP probe removed), #1717, #1720, #1721. Rollout: router objects suspended, openbao-config applied the policies first, then rb5009-b, rb5009-a, crs309 one at a time; no fuse left armed. Remaining for done-when: alerts and dashboards; firewall zero-byte rules still emit no series (mktxp 2.1.0 hard-codes matching-only).
Author
Owner

Monitoring is live (see the previous comment). Alerts and dashboard continue in lab/clusters#; zero-byte firewall rules in lab/iac#.

Monitoring is live (see the previous comment). Alerts and dashboard continue in lab/clusters#; zero-byte firewall rules in lab/iac#.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lab/iac#139
No description provided.