I am essentially trying to build is a poor mans server failover solution.
The non-profit organization I am part of is planning to host several web applications. In order to save on hosting costs we have decided to have the site hosted in-house. As a holdover until we can raise funds for a proper server room we have setup two desktop servers with virtual machines running the applications.
In terms of performance, the machines and the FiOS Business connection they are hosted on more than meet our current needs and they are in a colder dry area so cooling hasn't been an issue. The biggest problem going forward is a lack of any Battery Backup. The applications themselves are not mission critical and have been designed to be fairly robust and restore cleanly in the event of a power failure. However, our organization's website is also hosted on this server and is important enough to have some sort of redundant backup.
What I would like to build is a system where in the event of a power failure a UPS would provide emergency power to the servers and networking equipment and notify the servers of the power event. The servers would then make API calls to Amazon Route 53 DNS Service and reroute traffic away from the servers experiencing power failure and to a Heroku or Pagoda Box instance. These instances would run a Lite version of our website using content which is periodically pushed to them.
We are running a Linux environment. So how would a consumer-level UPS trigger a custom script on a power failure which puts the failover chain into effect?