Auto Shutdown when on UPS

Is there a way to shut down a B800fs when the power fails, and after 2 min of UPS power, send a shutdown command? I had the power fail at my house 3 times in 1 day. My UPS will only power my system for about 5 min (1500VA, I7 Computer, 39" 4k Monitor, Drobo 800fs, Network hub, misc hardware) The UPS is a USB connection and will shut down the computer, but how do I command line script a shutdown for the drobo?
Thanks in advance