Sending Email from ESX Servers
For my next trick, I’m working on a script that will send out an email (on a set interval) when old .vmx files are on an ESX server. This can cause issues when recovering from a disaster scenario, so the basic logic of my script will be:
Check registered Virtual Machines.
Check .vmx’s in \home\vmware
IF discrepancies = TRUE
THEN send email with list of discrepancies.
Foremost, I had to find a way to send email from an ESX server using an SMTP relay. Since Sendmail/Postfix/et cetera is not built into ESX I found a pretty easy solution. The first step is to download smtp_send.pl from vmguru.com. The second step is to download the MIME-Lite-3.01 library on your ESX server.
Once you have downloaded MIME-Lite-3.01.tar to your ESX server, install the library by typing the following:
tar zxfv MIME-Lite-3.01.tar.gz
cd MIME-Lite-3.01
perl Makefile.PL
make test
make install
You are now ready to use smtp_send.pl. Here’s a test message below:
./smtp_send.pl –t sinter@klaas.com –s “What I want for Christmas” –m “one BMW Z4 M Coupe Alpenweiss” –f fromemail@goeshere.com –r 192.168.1.1 (IP of SMTP Relay)
Later this week, I’ll put the script together.
- Jason Langone
Commenting is closed for this article.

2007 Systems Architech.