Let's say I have a Windows Server 2012 R2 server with a UPS attached.
Is there a generic way to make Windows Server 2012 R2 shut down when power fails, i.e., the system switches to battery power?
I know that most UPS vendors provide proprietary software to do that, and there are lots of tutorials online on how to configure them. However, I want to create a generic server image that will run on a variety of servers with (possibly) different UPS systems. Is there some way to do that without installing vendor-specific software?
This is actually really easy most UPS's support USB and the Battery appears as a standard HID Compliant battery so say Windows sees it (and I assume Linux) as big laptop battery in effect and the standard OS tools will manage it.
No, for the simple reason that the UPS provides the same power to the server regardless of whether it's on battery power or not. The UPS knows if it's on battery power, but thee server does not.
In order to get that information from the UPS, you have to connect to it and interrogate it for that information... but neither the queries nor the responses are standardized across UPS vendors, so you have the either use their custom software, or write up a custom script to handle the different commands and outputs for each vendor (and with some vendors, there are significant differences between models or product lines too).