3 ms·
> I prefer my own bugs In which case, you might wanna double check these return values https://github.com/tomszilagyi/upsc-snmp-agent/blob/8f35379d8c870ff522fa
by anon870 6y ago
> I prefer my own bugs
In which case, you might wanna double check these return values https://github.com/tomszilagyi/upsc-snmp-agent/blob/8f35379d8c870ff522fa559dc587dd0092181cfa/upsc-snmp-agent.py#L147 https://github.com/tomszilagyi/upsc-snmp-agent/blob/8f35379d...
- AstroNoise58 6y agoNot sure what problem you see with that, care to elaborate and/or open an issue?
- readflaggedcomm 6y agoIt never returns 1, and returns 4 in two cases. This varies from the comment before the function, which I presume documents return values (though at first glance I thought the "name(number)" format was a function call example).
- AstroNoise58 6y agoOh, ok, I guess that might be a bit confusing. :) 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'.