AstroNoise58
Joined 5 years ago
Joined 5 years ago
The comment documents the interpretation (by the UPS MIB) of possible return values. The same is true for the surrounding few functions (upsAutoRestart, upsBeeperStatus and upsOutputSource) that are similar in form and purpose. Obviously, there is no requirement that all possible output values are generated (exactly once or at all).
The function upsBatteryStatus returns 4 in two cases, because in both of those cases the battery is deemed 'depleted'. And it does not return 1 because there is no input case from upsc (that I know of, at least) where it would make sense to report the battery status as 'unknown'.
Speaking of prior art, I am only aware of this one: https://github.com/luizluca/nut-snmpagent I am not a fan of Ruby and I only trust software I wrote (a.k.a.: I prefer my own bugs in critical pieces of my infra), so here it is.
Posting in case someone else finds it useful, but will answer more general questions (should they come up) as well.
Edit: now I see Slashdot and Reddit mentioned at the end in the updates section (I don't remember seeing them on my first read, but that might just be me).
It invokes youtube-dl under the hood, but the user can add videos (to be downloaded) via the browser. It is quite usable as is, but pretty slim on features. Maybe someone here wants to take it further.