An Elegant Solution
Even though I don't have formal engineering training, I do have a long history of building and maintaining solutions and so I've learned the benefits of over building a solution. But, sometimes a simple solution is much better. With that in mind, let me outline my loss of power shutdown plan for my Raspberry PI server.
The Initial Plan:
My Raspberry PI is plugged into a APC UPS that doesn't have a USB port to trigger a system shutdown based on a lost of main power and low battery level. But, my wife's Windows PC is plugged into one. So I have been exploring the NUT service and plugged the PC's APC into the Raspberry PI with a long USB cable. Unfortunately that long cord caused some connection instability. And, even if it was stable there was still some risk. The NUT service on the Raspberry PI was going to have to wait for a power loss and then trigger a shutdown of the PC and then of the Raspberry PI. That plan included running the NUT software on both systems.
The Elegant Solution:
Instead of all of that, I'm going to plug the PC back into the UPC directly and let the Windows settings control the power. But how will the Raspberry PI know to shutdown? Ping the PC! The PC is constantly on, so when the ping fails it should be safe to assume that there is a power issue.
One Twist:
But what if the PC is down for another reason? I think I'll make it so that if the PI is restarted and the PC is offline, it will delay further checks so that I can keep it online. I'll just have to accept the risk that the PI could run out of battery power if the power does go down.