I use an APC with a management cable, triggers graceful shutdown and startup on reconnection. It also e-mails me and stores a log. I prefer this approach so 99% of ecosystem isn't on the server, you can let your server do server things and not be the battery police.
shutdowns can be done in software like 'sudo systemctl halt', so it doesn't need a line straight to the motherboard. That's the desired path because it lets running applications gracefully close and finish writing to disk.