From 7c1f5c3e386c9155fa527f46adc651e47a533574 Mon Sep 17 00:00:00 2001 From: Garrett Allen <98648590+Gerrrt@users.noreply.github.com> Date: Tue, 24 Nov 2026 03:40:13 +0000 Subject: [PATCH 1/2] docs(ups): NUT's driver retries for 14 seconds, riding out the card's stalls The data stale spells were the UPS card going silent for 2-8 s; NUT's defaults gave up at about 6 s. Records the snmp_timeout/snmp_retries arguments applied on morpheus on 2026-11-23 in the runbook, observability and the changelog. Refs #1503. Co-Authored-By: Claude Opus 5.5 --- docs/changelog.md | 12 ++++++++++++ docs/observability.md | 6 ++++-- docs/runbooks/shut-down-on-the-ups.md | 27 ++++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 1b446926..fa0daa2e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,18 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-23 +- **NUT's driver on `morpheus` retries for 14 seconds, not 6.** The *data + stale* spells come from the UPS card, not the network. A 45-minute capture + counted 93 stalls in which the card answered nothing for 2 to 8 seconds, about + twice a minute; ICMP to it lost nothing. NUT's defaults give up at about 6 + seconds, so only the two stalls longer than that, 7.1 and 8.2 seconds, became + spells, each logged the second its stall passed 6 seconds. At 18:36 local + *Extra Arguments to driver* gained `snmp_timeout = 2` and `snmp_retries = 6`, + still inside `upsd`'s 15-second `MAXAGE`. The first hour after had no spell + while the card stalled on 10 of the exporter's scrapes, but 13 of the 49 hours + before also had none, so a clean day is the bar. Why the card stalls is still + open. `shut-down-on-the-ups.md` carries the two lines and the reasoning. + - **`update-the-ups-firmware.md` is written, for #1698.** Reading the release notes changed the plan for both updates. The card's current firmware, 3.6.1.2, installs only through Schneider's Windows SNS tool and with a paid Secure NMC diff --git a/docs/observability.md b/docs/observability.md index 8eece1ff..2390fbe3 100644 --- a/docs/observability.md +++ b/docs/observability.md @@ -390,8 +390,10 @@ connected" ten times in three minutes, held for five, which is the driver on `NutCommunicationsLost` (critical) fires on upsmon's own "is unavailable", five minutes without UPS data on that host. `NutMonitorFailedToStart` catches an `upsmon` that refused its configuration and exited. The brief *data stale* -spells, about a hundred a day and seconds long, are left alone, but -`NutUpsDataStaleFrequent` warns when an hour has more than 24 of them, twice +spells are the UPS card going silent for a few seconds; since 2026-11-23 the +driver on `morpheus` retries for 14 seconds to ride them out +([`shut-down-on-the-ups.md`](runbooks/shut-down-on-the-ups.md#why-the-driver-retries-for-14-seconds)). +The spells that remain are left alone, but `NutUpsDataStaleFrequent` warns when an hour has more than 24 of them, twice the worst hour measured to 2026-11-23. Silence is left alone too: an `upsmon` that is not running logs nothing. That case, and `upsd` itself down, is `NutUpsUnreadable`'s in `prometheus/rules/ups.rules.yaml`, which asks `upsc` diff --git a/docs/runbooks/shut-down-on-the-ups.md b/docs/runbooks/shut-down-on-the-ups.md index 2ff65fd0..26f35d42 100644 --- a/docs/runbooks/shut-down-on-the-ups.md +++ b/docs/runbooks/shut-down-on-the-ups.md @@ -280,12 +280,17 @@ authPassword= privPassword= mibs=apcc pollfreq=15 +snmp_timeout = 2 +snmp_retries = 6 ``` `secName` is `prometheus` — the username in `generator.yaml`'s `auth_apc` block, which is the credential the exporter has already been using against this card since 2026-09-21. `mibs=apcc` names NUT's PowerNet MIB; `snmp-ups` -autodetects it and the line only makes the choice visible. +autodetects it and the line only makes the choice visible. The last two +lines give the driver about 14 seconds of retries before `upsd` marks the +data stale; [Why the driver retries for 14 seconds](#why-the-driver-retries-for-14-seconds) +says why. ### 1.4 Reveal and fill in Advanced settings @@ -347,6 +352,8 @@ secLevel=authPriv secName=prometheus mibs=apcc pollfreq=15 +snmp_timeout = 2 +snmp_retries = 6 LISTEN 127.0.0.1 LISTEN ::1 LISTEN 10.0.30.1 3493 @@ -1363,6 +1370,24 @@ for this one. Anything the driver needs beyond the address has to arrive through *Extra Arguments to driver*, which the package appends inside the `[mjolnir]` section. That is why the v3 credential goes there. +### Why the driver retries for 14 seconds + +The card stops answering SNMP for a few seconds about twice a minute. A +45-minute capture on `morpheus` on 2026-11-23 counted 93 such stalls, mostly +3 to 5 seconds and up to 8; the card sends nothing during one, neither a reply +nor an error. With the driver's defaults, one-second retries, NUT gives up at +about 6 seconds, and `upsd` marks the data stale. In the capture only the two +stalls longer than that, 7.1 and 8.2 seconds, became *data stale* spells, each +logged the second its stall passed 6 seconds and cleared on the card's next +answer. The exporter sees the same stalls as scrapes that time out at 5 +seconds. + +`snmp_timeout = 2` with `snmp_retries = 6` waits about 14 seconds, longer than +any stall measured and still inside `upsd`'s 15-second `MAXAGE`. So a card that +is really gone is still marked stale, about 8 seconds later than before. Why +the card stalls at all is not known; it is the card's own behaviour, not the +network's, since ICMP to it lost nothing during the capture. + ### Why `smaug` is a subscriber at all Until 2026-11-06 it was in the media room, not the rack, and nothing From 49a6179d4e4ade413d1bef596cc033f8466e2b27 Mon Sep 17 00:00:00 2001 From: Garrett Allen <98648590+Gerrrt@users.noreply.github.com> Date: Tue, 24 Nov 2026 04:44:37 +0000 Subject: [PATCH 2/2] docs(ups): the 14 seconds is per request; slow exporter scrapes were retried, not failed Review on #1702: upsd's MAXAGE counts from the driver's last message, so the retry budget does not set an outage-detection delay, and the exporter's 5 s is a per-request timeout inside a 45 s scrape. Co-Authored-By: Claude Opus 5.5 --- docs/changelog.md | 4 ++-- docs/runbooks/shut-down-on-the-ups.md | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 9b4d4263..b6d0a230 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -97,8 +97,8 @@ docstring gives: it is a record, not a claim about now. seconds, so only the two stalls longer than that, 7.1 and 8.2 seconds, became spells, each logged the second its stall passed 6 seconds. At 18:36 local *Extra Arguments to driver* gained `snmp_timeout = 2` and `snmp_retries = 6`, - still inside `upsd`'s 15-second `MAXAGE`. The first hour after had no spell - while the card stalled on 10 of the exporter's scrapes, but 13 of the 49 hours + about 14 seconds for each unanswered request. The first hour after had no + spell while 10 of the exporter's scrapes waited out a stalled request, but 13 of the 49 hours before also had none, so a clean day is the bar. Why the card stalls is still open. `shut-down-on-the-ups.md` carries the two lines and the reasoning. diff --git a/docs/runbooks/shut-down-on-the-ups.md b/docs/runbooks/shut-down-on-the-ups.md index fe0bceed..e19271fe 100644 --- a/docs/runbooks/shut-down-on-the-ups.md +++ b/docs/runbooks/shut-down-on-the-ups.md @@ -288,8 +288,8 @@ snmp_retries = 6 block, which is the credential the exporter has already been using against this card since 2026-09-21. `mibs=apcc` names NUT's PowerNet MIB; `snmp-ups` autodetects it and the line only makes the choice visible. The last two -lines give the driver about 14 seconds of retries before `upsd` marks the -data stale; [Why the driver retries for 14 seconds](#why-the-driver-retries-for-14-seconds) +lines give each unanswered request about 14 seconds of retries before the +driver gives up on it; [Why the driver retries for 14 seconds](#why-the-driver-retries-for-14-seconds) says why. ### 1.4 Reveal and fill in Advanced settings @@ -1392,12 +1392,16 @@ nor an error. With the driver's defaults, one-second retries, NUT gives up at about 6 seconds, and `upsd` marks the data stale. In the capture only the two stalls longer than that, 7.1 and 8.2 seconds, became *data stale* spells, each logged the second its stall passed 6 seconds and cleared on the card's next -answer. The exporter sees the same stalls as scrapes that time out at 5 -seconds. - -`snmp_timeout = 2` with `snmp_retries = 6` waits about 14 seconds, longer than -any stall measured and still inside `upsd`'s 15-second `MAXAGE`. So a card that -is really gone is still marked stale, about 8 seconds later than before. Why +answer. The exporter sees the same stalls as scrapes that take 5 seconds or +more: one of its requests waited out the exporter's default 5-second request +timeout and was retried. The scrape itself, with a 45-second +`scrape_timeout`, still succeeds. + +`snmp_timeout = 2` with `snmp_retries = 6` gives one unanswered request about +14 seconds, longer than any stall measured. That is a budget per request, not +the time to flag an outage: `upsd`'s 15-second `MAXAGE` counts from the +driver's last message, and how soon a card that is really gone is now marked +stale was not measured. Why the card stalls at all is not known; it is the card's own behaviour, not the network's, since ICMP to it lost nothing during the capture.