Repository navigation
snmp-ups: add sysContact and sysLocation support - #320
Conversation
jimklimov
left a comment
There was a problem hiding this comment.
Seems reasonable, except I don't like hardcoded things hidden in the code, so I'd suggest to at least replace the explicit OIDs with macros defined at some acceptable location, or even do proper mappings for this.
|
removing the milestone, since the tech solution is not clear enough for a short term implementation |
cfc1ac6 to
e2bf3ee
Compare
|
PR updated to address comments above: now each existing As a fallback, if a (future/custom) MIB table does not define any of those names, the While testing, found a bug in Also found a bug with tracking id sanity checks (precluded |
e2bf3ee to
952e35a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
|
Thanks to the last few commits, values like "device.contact" are now exposed once per device or daisy chain (for Checked with a daisy-chain master ePDU and daisy-chain slave ePDU (both with "eaton_epdu" MIB), and an Eaton 9PX 5000i UPS with ietf, mge, pw and pxgx_ups MIBs (all they use IETF MIB values for these fields though). Side note: with the UPS probed by 4 drivers at the same time, the one through which I had set the contact info did instantly report it back with |
03b83ec to
b1d6a6a
Compare
|
Back to drawing board :\ While testing, I checked that |
|
Good news (to post a bit later) is that we can discern in Bad news is that setting the value (upsrw) becomes very problematic, because For the location/contact/description in particular, daisychain seems to preclude detection of the values at "root" level (device.contact etc.) so it is populated by fallback (read-only IETF) for the master PDU device. |
|
For some reason, getting ALL bits to work, or be usable (e.g. both able to set daisy master and daisy slave and standalone devices) is a fine balancing act. What's more odd, at some point snmp-ups started for daisy devices (master or slave) with |
The generic MIB-2 provides system contact and location information that are now publish respectively as device.contact and device.location
The addition of sysContact and sysLocation support is now addressed centrally
…contact, location (RW STRING)
… sysContact and sysLocation only if mib2nut does not yet define a better value
… sysDescr also (only if mib2nut does not yet define a better value)
…as always a daisy-chain
…s that are likely measurements
…*.power|voltage|current)
…s about daisy-chained OID decisions
… logs to make sense of daisy-chain OID adaptations
…setinfo() when walking a daisy-chain with non-templated OID
…allback defaults for contact/location/description are only read once (not updated while driver runs)
…in master entry before defining IETF-MIB fallback defaults for contact/location/description
…ainloop(): trace connection faults and reconnections better
b1d6a6a to
dd196bb
Compare
|
With recent commits, behaviors can be deemed achieving the feature (somewhat clumsily but logically) unless proven otherwise, and are as follows:
Along this journey, added |
|
Presumably, for the data points in original question (contact, location, description) the quest is solved :) The more generic issue of non-templated OIDs used in daisy-chain context for many other if-else code branches seen but not trampled (outlets, alarms, *.alarm, commands, etc.) probably is not consistently addressed, but I have no good ways or ideas to even test for that. The best I can say about it currently is that "symptomatically" by the posted PR codebase state (took a week to get here with all the back and forth), there were no issues seen like lost data points or spurious new ones, when tested against a single UPS with 4 MIBs, a daisy master ePDU and a directly addressable daisy slave ePDU of same model; but I have no firm idea if there are things I missed going just by symptoms. |
….contact" not found as a "contact", and add another to strip "device.1." => "device." to allow setting non-templated values to daisy-chain master
dd196bb to
e2829cd
Compare
aquette
left a comment
There was a problem hiding this comment.
scripts/subdriver/gen-snmp-subdriver.sh should be amended too
|
At least, as of https://ci.networkupstools.org/job/nut/job/nut/job/PR-320/47/ the NUT CI farm liked this codebase per se, across the board :) |
|
Great catch, apparently I kept forgetting about the snmp/usb generator scripts in a few other PRs and had to post-process later :\ |
…" into new MIB mappings Kudos to @aquette for the catch in PR review
|
After discussion with @aquette this is good to merge. Experimentally the PR did not add regressions and did add features; the rest can be iterated later if found lacking: e.g. where I "fake" a |
The generic MIB-2 provides system contact and location information that are now
publish respectively as device.contact and device.location