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
2.07k stars 351 forks source link

Please expose remote UPS data through a win32_battery WMI driver. #326

Open mrudat opened 8 years ago

mrudat commented 8 years ago

It would be awesome if a WMI driver could be implemented that would present remote UPS information to windows using the win32_battery class (the way a directly attached UPS is exposed to native windows applications).

This would allow using the native power configuration control panel to configure behaviour when on battery, rather than having to have the monitor daemon configured to run the appropriate programs to achieve the same effect (where this is actually possible).

This would make it easier/possible to:

fragtion commented 7 years ago

Agree this is needed. It would either need to be implemented as part of upsmon.conf, or as a separate module

jimklimov commented 7 years ago

Now I wonder if there's equivalent functionality for Unix/Linux OSes - exposing an external UPS similarly to laptop battery, and/or exposing a local battery as a power device for NUT...

-- Typos courtesy of GMail on my Samsung Android

31.01.2017 15:24 пользователь "Dimitri Pappas" notifications@github.com написал:

Agree this is needed. It would either need to be implemented as part of upsmon.conf, or as a separate module

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/networkupstools/nut/issues/326#issuecomment-276376213, or mute the thread https://github.com/notifications/unsubscribe-auth/ABj5lFvhYbuVPK8VFUxLbiBitjcKiXmdks5rX0QrgaJpZM4KGCP- .

clepple commented 7 years ago

@jimklimov I don't think we have an issue open for this, but UPower is a successor to HAL, and is a possibility for exposing NUT data to the *nix GUI. In the other direction, we have #319.

@mrudat and @fragtion : it's good to know that there is interest in more advanced features, but what we really need is help re-implementing basic Windows support on something more recent than the 2.6.x branch of NUT. If you know anyone with experience in developing open-source software on Windows, issue #5 is our starting point.

6XGate commented 7 years ago

I don't know about the licensing (I think I used MIT), but I've got a NT service/daemon (still rough) that does expose Win32_Battery to NUT clients. Ya'll can borrow any code from it.

RoganDawes commented 4 years ago

I'd support the use of a Win32_Battery driver. In the simplest case, everything should just work with it running as a netclient, with a 1-line MONITOR entry a la upsmon. That could be stored in the Windows Registry. If needed, POLLFREQ and similar variables can also be set in the same location. Actions such as shutting down and hibernation, etc become the responsibility of the OS. To me this seems like the absolute minimum effort required to get a working Windows-based NUT client. And potentially, it could be added to the Windows core, much as APC did with their built-in Windows UPS driver.

RoganDawes commented 4 years ago

This page seems to be a good starting point for learning how to write a WMI provider: https://docs.microsoft.com/en-us/windows/win32/wmisdk/creating-wmi-providers

And https://docs.microsoft.com/en-us/windows/win32/wmisdk/developing-a-wmi-provider