Power source event trigger
Yes, using third party tools, like Power Manager, you can trigger scripts based on your UPS state.



Thirty party tools can monitor the UPS state through the IOKit and receive callbacks on state changes; thus avoiding polling.

If you are comfortable with shell script or AppleScript, Power Manager provides hooks for scripting your UPS in these languages.

I wrote Power Manager, so feel free to ask technical questions.