This is a really interesting thought experiment. Once I stopped being horrified of designing a custom power detection system and started thinking outside the box, fun began. Instead of engineering a device myself, I'd take an existing device and adapt it to power notification. Here's what I came up with just using cheap stuff around my home and shop...
Put a second network card in the FreeNAS server (if it doesn't already have a free NIC). Get the
cheapest four-port network switch you can find if you don't already have one. Plug the FreeNAS server into that switch which is plugged into house power. When you see the network port go inactive, you'll know the power is out. You don't even need to assign an IP address, link state is enough to see if there is power.
Do you have an
old USB hard drive that gets power from the wall instead of the USB port? Plug it into house power and mount the drive to your FreeNAS server. When power goes out and that partition starts throwing errors to the log, you'll know power is out.
Do you have a cheap desk lamp and a
FreeBSD-compatible USB web cam? There is a lot of code floating around that uses web cams as light sensors or security motion sensors. Point the cam directly at the light. The brightness change between powered and unpowered should be easily detectable and would indicate a power failure.
Is the place where your server located air conditioned? Is the air conditioner on a UPS? If not, you could easily get a
USB Thermometer and
some code that will tell you when the room is warming. A warming room would indicate a power failure. Want quicker notification than ambient room temperature? Duct-tape the temperature sensor to a burning light bulb plugged into house power. As soon as the power - and light light - goes off, you'll see a quick temperature drop.
Cheers,
Matt