I solved the problem with a Web/SNMP network management card connected via IP to a VM box.
Then I compiled the apcupsd driver (
http://www.apcupsd.org) inside a Linux VM box and in case of a
power failure I send the
/sbin/poweroff command to the ESXi host via ssh using an identity file.
The trick is to enable the SSH server inside the ESXi host, build a dropbear and openSSH RSA
root key with at least 768 bit on it, put all the keys inside the oem.tgz file, disable root login and
for safety reasons enable only the execution of remote commands (append -g to ssh line inside
inetd.conf) and configure the shutdown and startup sequence of every VM boxes.
Beforehand I tried the PERL Toolkit and stumpled over the problem that sending a shutdown command
using the
vmcontrol.pl command prevents the ESXi host to shutdown itself properly.
Please consider to use a big UPS in case you have plenty VM boxes to shutdown and don't forget to plan
the startup and shutdown sequence of all involved VM boxes with care.