monitoring (Add): mktxp RouterOS exporter scaffold, remove ER-X SNMP probe (lab/iac#139) #1715

Merged
ginjiruu merged 2 commits from mktxp-exporter into main 2026-11-17 19:42:42 +00:00
Owner

Scaffold for lab/iac#139: a mktxp RouterOS exporter on mini for rb5009-a, rb5009-b and crs309. Draft for review. Do not merge before the router side of iac#139 exists: the monitoring user, api-ssl with the OpenBao leaf, and the *_MONITORING_PASSWORD keys in OpenBao secret/routeros-secrets. Until those exist, the ExternalSecret can't sync and the pod stays in ContainerCreating. Nothing else breaks.

What it adds

clusters/mini/monitoring/resources/mktxp-exporter/, laid out like snmp-exporter/ (Deployment + Service + configMapGenerator):

  • mktxp.conf: one entry per device plus [default]. Connects over api-ssl on 8729 with ssl_certificate_verify and hostname checks on, against /etc/lab-ca/root.crt. Collectors are chosen per iac#139: bgp, routing_stats, netwatch, certificate, routerboard, IPv6 firewall, monitor (SFP), PoE and public_ip are on; wireless and capsman are off. crs309 turns off the routing, firewall and DHCP collectors and turns on switch_port.
  • _mktxp.conf: the upstream 2.1.0 defaults, except routers are fetched in parallel with a 20s per-router and 25s total budget, which stays under the 30s scrape timeout.
  • credentials.yaml: an ExternalSecret on the openbao ClusterSecretStore, the same store the routeros-*-env secrets use (vault-backend on mini is sealed). It renders one credentials_file YAML per device, with each password run through toJson so special characters stay valid YAML.
  • deployment.yaml: runs as uid 1000 with a read-only root filesystem. An init container copies the ConfigMap into an emptyDir, because mktxp rewrites its config files on start. The hostAliases match the iac routeros runners, since the device names aren't in DNS yet (iac#50).

Also:

  • scrapes/mktxp-servicescrape.yaml: a VMServiceScrape with job mini-mktxp, 60s interval and 30s timeout.
  • generic-templates/trust-manager/helmrelease.yaml: adds monitoring to targetNamespaces, so trust-manager writes the lab-root-ca ConfigMap there.

Removed

  • The ER-X ubnt_router SNMP probe and the snmp-exporter it used, on both mini and portable (scrapes/router-scrape.yaml, snmp-exporter/, and their kustomization entries). The ER-X has been out of service since the 2026-11-16 cutover, so no data is lost. Nothing else used snmp-exporter.

Not in this PR

  • Alerts and dashboards.
  • Firewall counters for rules that never matched. mktxp 2.1.0 hard-codes matching-only, so a zero-byte rule has no series. Alerting on a catch-all drop that stopped counting would need an upstream option or a patch.

Checks

  • kustomize build clusters/mini/monitoring/resources and flux build ks flux-system --path ./clusters/mini --dry-run both pass.
  • Local smoke test with ghcr.io/akpw/mktxp:2.1.0, using the same read-only root, uid 1000, the copied config and toJson-style credentials that include ", : and #. The config and credentials parsed, mktxp used the CA path (it failed on the empty test CA, as expected), and /metrics was served. Not tested against a real router: the router side doesn't exist yet.
Scaffold for lab/iac#139: a mktxp RouterOS exporter on mini for rb5009-a, rb5009-b and crs309. Draft for review. **Do not merge before the router side of iac#139 exists**: the `monitoring` user, `api-ssl` with the OpenBao leaf, and the `*_MONITORING_PASSWORD` keys in OpenBao `secret/routeros-secrets`. Until those exist, the ExternalSecret can't sync and the pod stays in ContainerCreating. Nothing else breaks. ## What it adds `clusters/mini/monitoring/resources/mktxp-exporter/`, laid out like `snmp-exporter/` (Deployment + Service + configMapGenerator): - `mktxp.conf`: one entry per device plus `[default]`. Connects over api-ssl on 8729 with `ssl_certificate_verify` and hostname checks on, against `/etc/lab-ca/root.crt`. Collectors are chosen per iac#139: bgp, routing_stats, netwatch, certificate, routerboard, IPv6 firewall, monitor (SFP), PoE and public_ip are on; wireless and capsman are off. crs309 turns off the routing, firewall and DHCP collectors and turns on switch_port. - `_mktxp.conf`: the upstream 2.1.0 defaults, except routers are fetched in parallel with a 20s per-router and 25s total budget, which stays under the 30s scrape timeout. - `credentials.yaml`: an ExternalSecret on the `openbao` ClusterSecretStore, the same store the `routeros-*-env` secrets use (`vault-backend` on mini is sealed). It renders one `credentials_file` YAML per device, with each password run through `toJson` so special characters stay valid YAML. - `deployment.yaml`: runs as uid 1000 with a read-only root filesystem. An init container copies the ConfigMap into an emptyDir, because mktxp rewrites its config files on start. The hostAliases match the iac routeros runners, since the device names aren't in DNS yet (iac#50). Also: - `scrapes/mktxp-servicescrape.yaml`: a VMServiceScrape with job `mini-mktxp`, 60s interval and 30s timeout. - `generic-templates/trust-manager/helmrelease.yaml`: adds `monitoring` to `targetNamespaces`, so trust-manager writes the `lab-root-ca` ConfigMap there. ## Removed - The ER-X `ubnt_router` SNMP probe and the `snmp-exporter` it used, on both mini and portable (`scrapes/router-scrape.yaml`, `snmp-exporter/`, and their kustomization entries). The ER-X has been out of service since the 2026-11-16 cutover, so no data is lost. Nothing else used snmp-exporter. ## Not in this PR - Alerts and dashboards. - Firewall counters for rules that never matched. mktxp 2.1.0 hard-codes matching-only, so a zero-byte rule has no series. Alerting on a catch-all drop that stopped counting would need an upstream option or a patch. ## Checks - `kustomize build clusters/mini/monitoring/resources` and `flux build ks flux-system --path ./clusters/mini --dry-run` both pass. - Local smoke test with `ghcr.io/akpw/mktxp:2.1.0`, using the same read-only root, uid 1000, the copied config and toJson-style credentials that include `"`, `:` and `#`. The config and credentials parsed, mktxp used the CA path (it failed on the empty test CA, as expected), and `/metrics` was served. Not tested against a real router: the router side doesn't exist yet.
ginjiruu changed title from WIP: monitoring (Add): mktxp RouterOS exporter scaffold (lab/iac#139) to monitoring (Add): mktxp RouterOS exporter scaffold, remove ER-X SNMP probe (lab/iac#139) 2026-11-17 19:42:39 +00:00
ginjiruu deleted branch mktxp-exporter 2026-11-17 19:42:42 +00:00
Sign in to join this conversation.
No description provided.