Repository navigation
Conversation
|
Preparing a ZIP file with standard source tarball and another tarball with pre-built docs for commit bfcf4e2 ... |
Some RFC 1628 agents (an RTCS 03.02.00 card, for one) number the upsInputTable, upsOutputTable and upsBypassTable rows from 0 instead of 1, so the single-phase voltages, currents, powers and load were never published. Read index .0 as well. Whichever instance does not answer is disabled at startup, and the .1 entry stays last so that it wins on an agent answering both. That card returns 0 for the input current, input power and output power, which it does not measure, so those three .0 entries treat 0 as invalid. The bypass current and power keep their zeros: 0 is the normal reading while the load runs on the inverter. Bump IETF_MIB_VERSION to 1.56. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fco Javier Felix <ffelix@inode64.com>
A UPS cannot be rated for 0 V, 0 Hz, 0 VA or 0 W, nor transfer to battery at 0 V, yet some agents (an RTCS 03.02.00 card, for one) return 0 for the upsConfig objects they do not implement, so the driver published input.voltage.nominal: 0, input.transfer.low: 0 and the like. Treat 0 as invalid for the six ratings and the two voltage transfer points, as voltronic-mib.c does for its ratings and transfer limits. upsConfigLowBattTime keeps its zero, which can be a real setting. Bump IETF_MIB_VERSION to 1.57. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fco Javier Felix <ffelix@inode64.com>
9b97947 to
130fae2
Compare
|
I reproduced the zero-handling limitation described in the PR on Could we keep the index-0 fallback and static-rating filtering, and allow zero on these three live readings by default? If the fixed-zero cells need hiding on the reported RTCS firmware, could we bound that to a reliably identified device or firmware quirk? The reproduction is synthetic and uses both |
SU_FLAG_ZEROINVALID on the .0 copies of input.current, input.realpower and output.realpower disabled each entry on its first 0 until the driver restarted: a value already published stayed frozen, and one that started at 0 never appeared. A 0 is a valid live reading (no load, or input power while on battery), so publish it, as the .1 entries do. The RTCS 03.02.00 card, which does not measure these three, now publishes them as 0 again. It cannot be told apart reliably (sysObjectID .0.0, generic sysDescr), so there is no quirk to bound the filter to. Bump IETF_MIB_VERSION to 1.58. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fco Javier Felix <ffelix@inode64.com>
|
Thanks for the reproduction. You're right: bfcf4e2 drops the flag from the I don't see a reliable way to bound it to the RTCS card: it reports |
|
✅ Build nut 2.8.5.6140-master completed (commit 23a10bb01a by @inode64)
|
Problem
An "RTCS version 03.02.00" SNMP card on a SRVPM6KRI UPS (
snmp-ups, whichpicks the
ietf_mibtable for it and reports it astripplite) published nosingle-phase line readings at all: no
input.voltage,input.frequency,output.voltage,output.current,ups.loadorinput.bypass.voltage.It also published
0for every rating and transfer point it does notimplement.
Two causes, one commit each:
upsInputTable,upsOutputTableandupsBypassTablefrom 0 instead of 1. RFC 1628 starts the line index at 1,and
ietf-mib.casks for.1, which this agent does not answer.0for theupsConfigobjects it does not implement, so thedriver published
input.voltage.nominal: 0,input.frequency.nominal: 0,output.voltage.nominal: 0,output.frequency.nominal: 0,output.realpower.nominal: 0,input.transfer.low: 0andinput.transfer.high: 0. OnlyupsConfigOutputVA(6000) is real.Device
upsIdentUPSSoftwareVersion456.00DT.I, single phasesysDescr"RTCS version 03.02.00",upsIdentAgentSoftwareVersion1.0,sysObjectID.0.0(so no vendor MIB is matched)Evidence
The line tables answer at index
.0only:and the configuration group returns 0 for everything but the VA rating:
The card does not measure input current, input power or output power either:
those cells are always 0.
Change
drivers/ietf-mib.c, three commits:IETF_MIB_VERSION1.56). Each of the 11single-phase entries (
SU_INPUT_1,SU_OUTPUT_1,SU_BYPASS_1) gets acopy at
.0, placed before it..0copy fails on the initial walk andsnmp-upsdisables it ("Disabling var"): one extra GET per entry atstartup. On this card the
.1entries are disabled the same way..1entry stays last, so an agent answering both publishes the RFCinstance.
.0copies keep their zeros, like the.1entries. This cardpublishes
input.current,input.realpowerandoutput.realpoweras0, since it does not measure them (see the third commit).
IETF_MIB_VERSION1.57).SU_FLAG_ZEROINVALIDfor the six ratings and the two voltage transferpoints, as
voltronic-mib.calready does for its ratings. A UPS cannot berated for 0 V, 0 Hz, 0 VA or 0 W, nor transfer at 0 V.
upsConfigLowBattTimekeeps its zero, which can be a real setting.IETF_MIB_VERSION1.58), from review. Thefirst commit used to flag the
.0copies ofinput.current,input.realpowerandoutput.realpowerwithSU_FLAG_ZEROINVALID. Thefirst 0 then disabled the entry until the driver restarted, so a
published value stayed frozen and one that started at 0 never appeared.
The flag is dropped from those three. The card above cannot be
identified reliably (
sysObjectID.0.0, genericsysDescr), so thefilter is not kept as a device quirk either.
NEWS.adocgets one bullet per commit under "snmp-upsdriver updates",and
docs/nut.dictthe new words (RTCS,SRVPM,KRI,upsConfig).SU_FLAG_ZEROINVALIDdisables an entry on its first 0 until the driverrestarts (
snmp-ups.c,su_ups_get()), so it is only used for the staticratings and transfer points, never for a live reading.
Not addressed: this card reports
upsEstimatedMinutesRemaining= 65535 as"unknown", which becomes
battery.runtime: 3932100.snmp-upshas no flagfor sentinel values, so that would need a core change.
Testing on real hardware
Tested and verified against the real SRVPM6KRI UPS described above.
1c4ab78c6,tripplite MIB 1.55): noinput.voltage,input.frequency,input.current,input.realpower,output.voltage,output.current,output.realpower,ups.load,input.bypass.voltage,input.bypass.currentorinput.bypass.realpower;and the seven zero ratings and transfer points listed above.
variables appear (
input.voltage228,input.frequency49.90,output.voltage228,output.current1.40,ups.load2,input.bypass.voltage228, the rest 0) and none is lost.three unmeasured zeros go away (53 to 43 variables); nothing else changes.
input.current,input.realpowerandoutput.realpowerare published again, as 0 on this card, as in thefirst-commit run. Not yet re-run on the hardware;
make checkpasses(
--with-snmp).1c4ab78c6, on that UPS, and since 2026-11-27 on top ofmaster(
984c382c1), installed from the build described next.(
sys-power/nut-9999, see below): NUTmasterat984c382c1with theoverlay patches (this PR, drivers/eaton-ups-pwnm2-mib.c: read xupsBypassVoltage.1, add the transfer points #3873 and drivers/mge-mib.c: also read the input line cells published as scalars #3874), compiled there (each host its own binary), not installed, and run
once in dump mode next to the production driver
(
snmp-ups -s test -x port=... -u root -d 1, plus a-DDDDrun to listthe entries disabled at startup).
Result: the same variables as the production driver, none lost or added;
input.voltage233,input.frequency50,output.voltage229,output.current1.50,ups.load3,input.bypass.voltage233,output.power.nominal6000,ups.statusOL. With-DDDD, each.1instance and each zero-valued entry shows up once as "Disabling var".
mibs=ietfagainst two Eaton cards thatnumber the lines from 1 (the devices of drivers/eaton-ups-pwnm2-mib.c: read xupsBypassVoltage.1, add the transfer points #3873). Each
.0entry gets one GET at startup and is disabled,the
.1values are published, and the non-zero ratings (220 V, 50 Hz,6000 VA, 6000 W) and transfer points (100 and 276 V) are kept.
Local checks, on Gentoo Linux x86_64 (gcc 16.2.1, Net-SNMP 5.9.5.2), with the
three related branches applied together on
master(984c382c1):make check,make spellcheckandmake distcheck-lightpass, and theadded lines are plain ASCII (
git diff --checkclean).Our overlay
These patches are also carried in our public Gentoo overlay,
https://github.com/inode64/inode64-overlay (
sys-power/nut/files/, appliedby
sys-power/nut-9999), which several of our servers use to build NUT.This pair has been in production on the host with this UPS since
2026-11-09.
Since 2026-11-27 all our servers with a UPS run that build (NUT
master984c382c1with the patches of this PR, #3873 and #3874), with USB,serial and SNMP drivers:
usbhid-ups,nutdrv_qx,apcmicrolink, andsnmp-upswith theapcc,eaton_pw_nm2,ietfandmgesubdrivers. Novariable was lost on any of them, except an
input.transfer.reasonthatusbhid-upsno longer reports on one host upgraded from NUT 2.8.2, which isunrelated to these patches.
We will drop them from the overlay once this is merged.
AI disclosure
The analysis, the patches and this text were prepared with Claude Code
(model: Claude Opus 5.5) under my direction; the commits carry a
Co-Authored-Bytrailer for it. I reviewed and signed off each commit. TheSNMP data and the test output above come from the real devices.
Checklist
against, and the limitations.
AsciiDoc.
snmp-ups, no obsolete driverextended.
IETF_MIB_VERSIONbumped (1.55 to 1.56, 1.57 and 1.58).docs/nut-names.txt: no new variable names.data/driver.list.in: not changed, the devices are covered by theexisting
snmp-upsentries.NEWS.adoc; nothing forUPGRADING.adoc.make spellcheck; addedRTCS,SRVPM,KRIandupsConfigtodocs/nut.dict.make distcheck-lightpasses locally.🤖 Generated with Claude Code