Well, your NAS devices need to support the UPS and have a configuration utility to let you tell it what to do (i.e. shutdown when battery life hits X%). They would also need to support external remote control if you have multiple devices going to the same UPS as almost no UPS has USB connections for multiple systems (so that a remote device can then signal the NAS to shutdown). APC has their PowerChute software suite that lets you have a system able to connect to another system that has the USB or serial connection to an APC UPS to monitor the power through that other system. You create agents/commands under the powerchute software (i.e. a script that tells it how to shutdown the remote systems, so for instance if it was a windows system you would create a script: "@START "" "c:\Windows\system32\suhtdown.exe" /s /t 10 /m \\hostname_of_client_you_want_to_shutdown"
You then configure the system to run the agent when the battery hits a certain value. The NAS would need to support some kind of command that you can tell it to remotely shutdown and then you would need to program that into an agent command in powerchute (like the above), and then configure powerchute to run it.
If you are using linux, you can use either apcupsd or nut. Both of which will let you configure similar type things as the PowerChute does under Windows.