联系

在 Proxmox 上构建 ISP 监控堆栈

首页 / 博客

8 分钟阅读
ZILL E ALI2026年4月18日教程

可靠的 ISP 监控堆栈在 Proxmox 主机上应在您构建的每个 POP 中保持相同。

每个 POP 都使用相同的监控构建,因为在故障期间设计监控是最糟糕的时机。这就是堆栈、规模以及真正触发的警报。

ISP 监控堆栈 Proxmox 主机

组件 角色 容器规模
LibreNMS SNMP 轮询、设备清单、告警 4 vCPU,8 GB RAM,100 GB
Grafana 用于 NOC 屏幕和管理的仪表板 2 vCPU,2 GB RAM,20 GB
SmokePing 延迟和丢包基准 1 vCPU,1 GB RAM,20 GB
Uptime Kuma 面向公众的服务检查和状态页面 1 vCPU,1 GB RAM,10 GB

所有四个组件都作为非特权 LXC 容器运行在单个 Proxmox VE 节点上。约 800 台受监控设备时,节点 CPU 使用率约为 6%——瓶颈在于 RRD 写入导致的磁盘 I\/O,而非计算。将 LibreNMS 容器放在 SSD 上。

ISP monitoring stack Proxmox hosts: VE node running LibreNMS, Grafana, SmokePing and Uptime Kuma containers polling the network over SNMP v3

避免返工的构建顺序

  1. Proxmox 主机: 为容器和备份提供独立存储,如果有足够内存可使用 ZFS,并且在面向客户的网络不可用时仍可访问的管理 VLAN。
  2. 首先部署 LibreNMS, 使用 SNMP v3(auth + priv)——在面向公众的边缘使用 v2c 社区字符串是潜在的安全隐患。
  3. SmokePing 指向您的上游网关、像 1.1.1.1 这样的公共锚点以及每个塔式路由器。
  4. Grafana 最后,从 LibreNMS 读取。不要在了解故障原因之前构建仪表板。

RouterOS 上的 SNMP

\/snmp community\nadd name=nms-v3 authentication-protocol=SHA1 encryption-protocol=AES \\\n authentication-password= encryption-password= \\\n security=private addresses=10.60.0.0\/24\n\n\/snmp\nset enabled=yes contact=\"[email protected]\" location=\"POP-A\"

限制 地址 到监控子网是监控与信息泄露漏洞之间的区别。

导致图表偏差的 SNMP 轮询错误

我收到的一半“LibreNMS 在骗我”的投诉都可以追溯到这些问题,而不是 LibreNMS 的 bug:

  • 在超过 1 Gbps 的接口上未设置 ifHighSpeed。 LibreNMS 会回退到 32 位的 ifSpeed 计数器,其计算上限为 4.29 Gbps,超过此值会悄悄产生错误的百分比。确保高容量接口以 Mbps 报告 ifHighSpeed,RouterOS 在 SFP28/QSFP 端口上默认正确实现——错误通常来源于旧的自定义 MIB 覆盖,而非 RouterOS 本身。
  • 在全站范围内以小于 60 秒的间隔轮询“以确保安全”。” 在几百台设备上,这会使轮询器本身成为瓶颈,负载下会丢失轮询,从而触发错误的设备宕机告警。五分钟一次的轮询足以进行容量趋势分析;对于您真正需要的延迟分辨率,请使用 SmokePing,而非 SNMP 轮询。
  • 每个设备使用一个 SNMP 社区。 Fine for a lab, not for 28 sites – if one router’s community leaks, you are rotating credentials everywhere at once instead of on one device. Scope community/v3 users per site or per device tier.
  • Trusting default RouterOS SNMP OIDs for queue stats. Simple queues report differently from queue trees in SNMP. If PCQ or HTB is doing the real shaping, poll the queue tree OIDs directly rather than assuming the simple-queue graph reflects actual throughput.

Adding flow visibility with RouterOS traffic-flow

SNMP tells you how full an interface is. It does not tell you which subscriber, protocol, or destination is filling it – that is what NetFlow/IPFIX is for, and RouterOS exports it natively without extra licensing:

/traffic-flow set enabled=yes interfaces=all cache-entries=256k active-flow-timeout=30s /traffic-flow target add address=10.60.0.5 port=2055 version=9 v9-template-refresh=20 v9-template-timeout=30m

Point that at a flow collector (nfdump, or LibreNMS’s own flow support if you enable the module) and keep it on the same monitoring VLAN the SNMP community is scoped to – a flow export is itself traffic metadata worth protecting. This is what actually answers “why is uplink utilisation suddenly at 90%” during an incident instead of just confirming that it is.

Alerts worth waking up for

Most default alert sets are noise. These are the rules that earn their place:

  • Device down for 3 polls — not 1. A single missed poll is usually the poller, not the device.
  • Interface utilisation > 80% for 15 minutes — capacity planning signal, not an emergency page.
  • Uplink packet loss > 2% for 5 minutes — this is the one that catches upstream problems before the phones ring.
  • PPPoE session count drops > 20% in 10 minutes — a tower or BNG problem, visible before individual complaints.
  • Optical RX power drift > 3 dB from baseline — a splice or connector degrading; fix it in daylight rather than at 2 am.
  • Proxmox host disk > 85% — because the monitoring dying silently is the worst failure of all.

Route them by severity: chat for informational, phone call only for the ones that mean customers are offline.

Grafana panels worth building on day one

An empty Grafana instance is worse than no Grafana – it invites someone to build a dozen panels nobody reads. Start with five that earn a daily glance:

  1. Top 10 interfaces by utilisation, sorted descending, refreshed every minute – the single panel that answers “is anything close to saturated right now.”
  2. SmokePing latency heatmap per upstream – a slow creep here predicts a support-ticket spike before it happens.
  3. PPPoE active session count over 24 hours, per BNG – a flat line at the wrong time of day is as informative as a drop.
  4. Optical RX power per ONU/OLT port, trended over 30 days – this is the panel that turns the alert threshold in the next section from a guess into a baseline.
  5. Proxmox host resource panel – CPU, RAM, and disk I/O for the node running the monitoring stack itself, because a monitoring stack that cannot see its own host failing is not finished.

Retention and backups

RRD data compacts on its own; the database does not. Keep 90 days of syslog and eventlog, and back up the LibreNMS database plus /opt/librenms/config.php nightly to a different physical box. Snapshot the containers weekly from Proxmox.

Test a restore once. A backup you have never restored is a belief, not a backup.

What this stack does not replace

Worth saying plainly: LibreNMS, Grafana, SmokePing, and Uptime Kuma answer “is something wrong and roughly where” – they are not a ticketing system, an escalation chain, or a root-cause database. Pair this with:

  • A real ticketing/escalation path, even a simple one, so an alert in chat actually becomes an owned task with a timestamp – “someone saw it in the channel” is not the same as “someone is working it.”
  • A change log separate from monitoring, so when a graph shifts at 3pm, the first question – “did someone change something?” – has a fast answer instead of starting an investigation from zero.
  • Vendor support contacts and SLAs for anything this stack flags but cannot fix itself, like upstream packet loss on a transit link that is not yours to touch.

A monitoring stack earns its keep by shortening the gap between “something broke” and “someone who can fix it knows exactly what broke.” Everything in this guide is in service of that one gap – nothing here matters if the alert fires into a channel nobody is watching at 2 am.

Multi-POP visibility: one LibreNMS instance or one per site?

One central LibreNMS instance polling every POP over a site-to-site tunnel works fine up to roughly a dozen sites, as long as the tunnels themselves are reliable – the moment a WAN link to one POP flaps, every device behind it reports down at once, which is correct but noisy. Past that, two patterns actually hold up:

  • Regional LibreNMS instances (one per metro or per upstream provider), each feeding a shared Grafana that reads from all of them via multiple data sources. This isolates a WAN flap to one instance’s alerting and keeps the blast radius of any single LibreNMS outage small.
  • A lightweight local poller per POP (a small LXC running just SmokePing and a distributed poller agent) reporting back to one central LibreNMS, so latency/loss detection survives even if the backhaul to the central instance briefly drops – the local poller buffers and catches up.

Neither pattern is worth building before you actually have the multi-site problem. A single LibreNMS instance covering every POP from one Proxmox host, per the build order above, is the right starting point – this is the upgrade path once that instance is itself page one of the dashboard every morning.

Start smaller than this

If you are deploying your first POP, run LibreNMS and SmokePing only. Add Grafana when someone asks for a wall display, and Uptime Kuma when you want a public status page. A monitoring stack you understand end to end beats a bigger one you inherited and never verified.

作者

ZILL E ALI

拥有 MTCNA 和 MTCRE 认证的网络工程师、ISP 基础设施专家,Developer Zon 创始人。在此撰写关于 MikroTik、Cisco、ISP 基础设施以及偶尔的构建日志。

留下回复

本站使用 Akismet 来减少垃圾评论。了解您的评论数据如何被处理。