There is UPS support built into the firmware (later versions) which allows you to automatically shut down the 323 in the event of a power failure - it's a very primitive NUT implementation and there are no configurable paramaters, so it doesn't show in the GUI.
Plug your 323 into the UPS power, and connect the UPS comms cable to the USB port and power up the DNS-323, if you can see the UPS listed on the status page, it's probably good to go.
Unplug the UPS from the outlet and the status should change to reflect that, and when the UPS sends a low battery signal (after however long it takes to drain the battery) the NAS should power off - I would have preferred if they had made the "on battery time" user configurable, running a UPS battery to total depletion is a sure fire way to reduce it's expected lifespan.