Concerning software, you have (at least) three options:
1. original "PowerChute" software
2. free "NUT" (network ups tool)
3. free "apcupsd".
I'd recommend to use NUT for one reason: there is vib available, and it can be installed directly on esxi-server (although only in "slave" mode), then "talk" to master-server, and shut esxi down automatically if necessary. With other two tools (apcupsd or PowerChute) you have to install software only on one VM (i.e. vMA), and in case of power-off event shutdown esxi-server using ssh (which I find insecure: if someone gain access to that VM, he can found password or keyfile to access esxi-server).
Here is a few links I found, maybe you can find something usefull there:
Jim's Technology Corner: UPS, vSphere, APCUPSD, PowerCLI and IPMI
How to configure ESXi to shutdown using an APC SmartUPS (with lamw scripts)
No Joke IT: Shut down ESXi 5.1 guest VMs and the host (free edition) via SSH - the easy way!
http://rene.margar.fr/2012/05/client-nut-pour-esxi-5-0/ (it in french, so use i.e. google translate)