Step 1 – Upload the Esx-health.pl script to your VMA server
I currently use the excellent esx-health.pl script originally developed by William Lam with additional modifications from James Pearce.
Then copy this perl script to your VMA. I use Veeam Backup & FastSCP for this.
Step 2 – Execute code
Connect to the VMA and change to the directory where you copied the Esx-health.pl script
Navigate to the directory where you have copied the perl script and make sure you have execure permissions by entering:
chmod +x Esx-health.pl
Execute the below command:
./Esx-health.pl –server –username root –mailhost –maildomain –mailfrom ESXMonitor@ –mailto
Note – I find issues when pasting hypens (i.e. “-”) if you get an error running this command try deleting and retyping the hypen. Weird but seems to work.
Note that the command is case sensitive
You will be prompted for the password for the ESX server.
You should shortly receive the health check email
If you don’t receive this email then it may be due to the SMTP server not being setup to allow relays from the VMA’s IP
Step 3 – Schedule the script to run
In the below example I am scheduling the perl script to run everyday.
- Logon to the VMA and enter the command crontab – e
- Enter the command to run the perl script. The below command will run daily at 08:01
- 01 08 * * * ./Esx-health.pl –server –username root –password –mailhost –maildomain –mailfrom ESXMonitor@ –mailto
- Once you have entered this press CTRL + C to exit
- Then type :wq to save and quit
Note – I haven’t found a way to send to more than 1 email receipient. If you want to send to multiple recipients then I recommend setting up a separate cron job for each
- You can verify your entry is listed by running crontab –l
Note – To avoid passing the root password in plaintext you can use vifastpass
Please Click any of the following link
No comments