Many small business and home networks have PCs, Home/Media servers and NAS devices running 24/7 but how many of us think about what happens when the power cuts off? These days our national grid is pretty good but we can still lose the power at any time. For instance this weekend my wife plugged in the kettle and blew all the sockets in the house. At the time my PC was converting a lot of files which could potentially have been trashed or worse still my PC could have been badly damaged. Fortunately I have an Uninterruptable Power Supply (UPS) so my PC carried on regardless.
The trouble is if you have a number of devices you want to protect and shut down in the event of a power cut you need to have a networkable UPS and these are costly for a small business or home user's budget. However there is another option; using WinNut.
I currently have a ReadyNAS Duo and a PC that I want to shut down if the power goes. So I got hold of an APC Back-UPS for around £60 including VAT, a reasonable price on a home budget. This connects directly via USB to my NAS which then controls the shutdown of itself and my PC.
How does it work?
The NAS will shut itself down automatically when it sees the battery level in the UPS get to a certain threshold. But it can also be configured to send a signal to network devices that are monitoring the network for shutdown commands. You do this in the UPS Configuration by ticking "Enable network monitoring of attached UPS" and then adding the device IP address in the "Hosts allowed access" box.
You can also add a subnet in here as I have done in the picture.
Now we need to set up the PC. In order to allow your devices to monitor the network for UPS shutdown commands you need to install a piece of software called WinNut, it's free.
Once you've downloaded and installed WinNut, open the configuration tool which looks like this:
Ticking "Install As Service" and choosing Automatic Startup will ensure that the software starts up each time you boot Windows.
Choosing "Forced" as the Shutdown method will ensure any open programs are closed without Windows waiting for you to say yes!
If you want to delay the shutdown on your device tick "Use Timed Shutdown" and add the number of seconds in the box.
The next thing you need to do is edit the Configuration File. Clicking the Edit button will bring it up in Notepad. The bit that needs editing is the first section under MONITOR. You need to alter the IP address to that of your NAS.
Finally click the "Apply and Start WinNUT" button and you are now protected. Or are you? It's always a good idea to test it works when it doesn't matter rather than find out it doesn't when you need it to. Pull the plug on your UPS and make sure your NAS and PC shut down properly. I would also suggest testing it on a regular basis to maintain confidence.
If you find that the NAS shuts down but your PC doesn't check that port 3493 is open on your firewall.
That's all there is to it. By the way I now have a nice new kettle that tells you when it's still hot!