The UK village where I live has what can best be described as a very flaky power supply -- I can expect a brown-out once a week, and a power cut maybe once a month. In the last-but-one power-cut, one of my two Buffalo Linkstation Mini NAS units died and has defied all resuscitation attempts. It has now been replaced and I'm intending to install a UPS to protect as much as possible of my home-office network.

The UPS I've investigated (APC BE700G-UK) will allow me to connect my PC, my monitor, one of my two Buffalo Linkstation Mini NAS units and my network switch to battery backup outlets; and my router, printer, other NAS and wireless broadband aerial to surge protection outlets. In the event of a power cut (which is very likely to outlast the NAS battery) the UPS would shut the PC down gracefully (via a USB conntection), but everything else would go down in an unmanaged fashion, either when the power failed or when the UPS battery failed some time later. If I'm in and awake, I can perform manual shutdowns but that won't always be the case.

There's an option in the APC UPS to slave the devices on battery protected circuits to the PC -- when the PC powers down, the slaved devices lose power -- but in normal operation that isn't useful when the NAS units are required to run in the absence of the PC (they serve music plus data to laptop PCs in the house).

Is there any configuration -- either with this NAS or another one -- that would allow me to shut the PC and both NAS units down gracefully in the event of a power cut, but allow the NAS units to continue running when the PC is powered off in normal operation?

  • Using APC slave device feature won't be much better than leaving the NAS unprotected. It will still lose power abruptly which may cause data loss at best, device breakdown at worst. You shall rather find a way to (a) order NAS to power down by itself, using some sort of command, (b) trigger that command by OS when battery gets low (APC software stores corresponding events in event log). – Michał Sacharewicz Sep 15 '13 at 16:27
  • @MichałSacharewicz I realise that hence the question. – ColeValleyGirl Sep 15 '13 at 16:37

I do not own any of these devices, therefore I can give you only basic draft of the solution.

First, as explained in a comment earlier, you have to get two things to work:

  1. A way to remotely shut down the Linkstation using OS-based command (Windows, I presume?).
  2. A way to trigger that command when the juice is running out.

Step 1: The Command

As indirectly found here, there is a Java app named acp_commander.jar (download) that can remotely control a Linkstation device. Based on the README file, the correct command to shutdown a remote device is:

java -jar acp_commander.jar -shutdown -t <nas_hostname_or_ip>

Of course, you need Java JRE for it to work.

Unfortunately I cannot test it, and I do not understand why does it not require any authentication. Hope that it works, if not, try to find more here.

Step 2: The Trigger

Assuming you have Windows OS connected to the APC via UPS and the APC software (APC PowerChute) running, all events regarding UPS work should be stored by APC software in Windows Event Log. You may confirm that by searching Event Log (Application folder) for events logged by APC Data Service and APC UPS Service.

Now you need to create a corresponding command trigger, using Windows Scheduler.

  1. launch the Scheduler,
  2. create a new task,
  3. configure it to launch the command mentioned in step 1 (after testing it), see Actions tab - remember to separate command from arguments:
    • Command: java
    • Arguments: -jar acp_commander.jar -shutdown -t <nas_hostname_or_ip>
  4. now configure the trigger for the event - push New trigger in Triggers tab (you may also check screenshot):
    • Begin the task: On an event
    • Log: Application
    • Source: APC UPS Service
    • Event ID: 177
  5. review all other settings in the task and set them at your discretion

After saving the task, your Windows Scheduler will launch the command each time event 177 is logged by APC UPS Service. This event means PowerChute causing PC to hibernate.

This of course assumes that You've configured APC PowerChute to hibernate your PC when the battery is dying.

You may also search for other events than 177, if they were to better suit your needs.

Hope it helps! :)

  • Unfortunately, although acp_commander.jar communicates with my Linkstation Mini, the Linkstation interprets the command to halt -shutdown -h now as a command to restart, so this solution won't work with the Linkstation. – ColeValleyGirl Sep 22 '13 at 14:33

If I understand the protection requirement, the NAS devices are on all the time and a logical solution would be for a suitable NAS to drive the controlled shut-down of other devices on the network.

First the bad news - I cannot answer for the Buffalo Linkstation NAS device, and that will require further investigation. However, the link below is a relevant post for a Synology NAS using the APC UPS you mention: http://www.gadgetvictims.com/2010/02/battery-backup-solution-for-home.html. The article describes using the single USB port on the UPS connected to the Synology NAS. The Synology NAS has the functionality to communicate to other networked devices (principally other Synology NAS devices). Installing WinNUT (free) on the PC means it too can receive the communication from the Synology NAS and initiate shut-down. WinNUT apparently works on W7, but the post is 2010, so nothing about W8.

Judging by the updates at the foot of the gadgetvictims article, there may be some tweaks to do, but overall this may give you an avenue for further investigation.

Hope this helps.

  • As per superuser.com/a/645852/183139 the Linkstation NAS supports UPS connectivity via a USB connection, and one Linkstataion connected to the UPS can trigger other Linkstations on the same NAS to shut down. So WINnut might work with the Linkstations as well. – ColeValleyGirl Sep 16 '13 at 8:42
  • For WiinNUT to work withthe lnkstations, it needs a user name and password on the Linkstation that has the privileges to monitor the NAS.There's no way to create a specific account for this purpose; the admin account doesn't work and neither dopes the root account (even when I hack the password so that I know what it is). – ColeValleyGirl Sep 22 '13 at 14:34

The Buffalo LinkStation Mini supports UPS connectivity via a USB connection. So, what I would suggest is buying a different UPS that has more than one connectivity port. UPS's that have a serial port and a USB port are very common. You could then do the following...

  1. Connect the LinkStation to the UPS via USB and use the utility on the LinkStation to shutdown the NAS in the event of power failure to the UPS.
  2. Connect the PC to the UPS via serial. If your PC doesn't have a serial port, then you can get a USB to serial adapter pretty cheap.

Personally, I wouldn't go with any other solution. This method only has has one or two points of faiilure for each device. Any other method is giong to introduce too many points of failure, especially if you're talking about a Java based application sending a message over a network connection. Then you've got the following points of failure.

  1. The application itself.
  2. The Java Runtime.
  3. The PC and all of its components:
    • Operating System
    • RAM
    • Hard Drive
    • Motherboard
    • Network Card
    • Drivers
  4. The switch connecting the NAS and the PC.

If any one of these bullet points fail, your NAS doesn't get shutdown safely. Having each device directly connected to the UPS is the way to go even if it ends up costing a little more. You're liable to pay the price either way.

  • Surely you listed all the points of failure correctly. Yet what you propose in stead is simply not valid in our case. You've got three devices to cover (1x PC, 2x NAS). Yet even if you had found a three-USB UPS (were it worth to buy), it would still be an overshot. Sure, everything fails from time to time, but how often really? Remember, our case is a simple home setup. But hey! Even in enterprise deployment you wouldn't use any multiple-USB UPS, with all the issues with getting right drivers for heterogenic env., you'd rather use SNMP - over the good, old, unreliable switches :) – Michał Sacharewicz Sep 16 '13 at 2:03
  • @MichałSacharewicz, He said in the question only one NAS was going to be connected to the battery backup outlets. But you do realize your answer doesn't meet all of the requirements of the question either? The questions states "...but allow the NAS units to continue running when the PC is powered off in normal operation?" If the PC is powered off and the power goes out, his NAS unit(s) won't shutdown safely. – Drew Chapin Sep 16 '13 at 2:17
  • What about the best-of-both-worlds solution then? Let's connect one NAS to the UPS via USB, then tell PC to monitor that NAS status and when that NAS goes down, send shutdown to the second NAS and hibernate. Sounds like a good contraption now? :D – Michał Sacharewicz Sep 16 '13 at 7:23
  • That choice is up to @ColeValleyGirl, but still sounds like a bad solution to me. – Drew Chapin Sep 16 '13 at 8:55
  • Ideally I'd like to cover both NAS units with the UPS (and can do it with a power splitter, which is OK as they're low power consumption). I agree with @MichałSacharewicz -- in a home office environment, protecting against multiple simultaneous failure modes is overkill. And using a NAS as master for the shutdown process seems the way to go. – ColeValleyGirl Sep 16 '13 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.