I need to generate a SMS / Email alert when the server´s UPS is finishing its charge. We have a car battery connected to the motherboard that works as a UPS (http://www.mini-box.com/M2-ATX-160w-Intelligent-Automotive-DC-DC-Power-Supply) When this device detects that battery is lowering the voltage, its send an ON pulse to the motherboard. Somehow Ubuntu (i´m using version 11) detects this pulse and shows a screen telling that in 60 seconds ubuntu will shutdown. I need to execute a script to call a webservice to notify this situation. How can I trap that alert? I have also tried also using a script in rc0.d but it is not calling my WS (seems that network is down before it is executed). How can I alternatively execute something in runlevel 0 before network is down?