networkupstools / nut

The Network UPS Tools repository. UPS management protocol Informational RFC 9271 published by IETF at https://www.rfc-editor.org/info/rfc9271 Please star NUT on GitHub, this helps with sponsorships!
https://networkupstools.org/
Other
1.92k stars 346 forks source link

Battery statuses and system statuses (New Driver creation) #739

Open TheKaban opened 4 years ago

TheKaban commented 4 years ago

Hello!) Having difficulty writing a new Sub-Driver for SNMP-UPS.

Please tell me, for battery statuses, should I use SU_STATUS_BATT, and for system statuses should UPS use SU_STATUS_PWR? For both cases info_type will be ups.status? Do I get it right?

For my ups, I have the following statuses: Battery Statuses: {1, "UNKNOWN"}, {2, "BATTERY-NORMAL"}, {3, "BATTERY-LOW"}, {4, "BATTERY-DEPLETED"}, {5, "BATTERY-DISCHARGING"}, {6, "BATTERY-FAILURE"}

System Statuses: {1, "POWER-ON"}, {2, "STAND-BY"}, {3, "BY-PASS"}, {4, "LINE"}, {5, "BATTERY"}, {6, "BATTRY-TEST"}, {7, "FAULT"}, {8, "CONVERTER"}, {9, "ECO"}, {10, "SHUTDOWN"}, {11, "ON-BOOSTER"}, {12, "ON-REDUCER"}, {13, "OTHER"}

How can I apply these statuses in NUT?

From this, I only realized that: LINE == OL BATTERY == OB But I would like to understand what the other statuses are equal to. Can they help me find a mark on these questions?

Thank you all for your attention and help! Good luck

jimklimov commented 2 months ago

I think your best bet at the moment is to look at other drivers (maybe not only SNMP MIB mappings), to see how they behave. Quite a few of these values are fairly recognizable in existing code, some may be alarms rather than (or in addition to) statuses though. Currently well-recognized names are listed in docs/new-drivers.txt section on Status data aka https://networkupstools.org/docs/developer-guide.chunked/new-drivers.html#_status_data