Script - Checking ESX Disk Space Usage from a Central Linux Box

February 4th, 2008 |
Comments (2)

A couple of weeks ago, Duncan over at yellow-bricks.com posted a nice script which gathers the disk usage of an ESX host. I thought it was a nice piece of work, but didn’t quite fit my needs. So, I decided to modify it a bit.

The concept of the original script was to run the script locally on each ESX box through cron and then send an email of the results. In my experiences, I have found locally run cron scripts to be a bit of maintenance pain (for the most part, there are some exceptions).

That being said, I have updated the script to run from a central linux box. There are some caveats to the script:

  • The script expects SSH key authentication to be working (RTFM has a quick guide here for those who aren’t familiar)
  • By default, the script will look for a file called ‘esx_hosts.txt’ in the same directory as the script. This file should contain a list of the ESX hosts you want to query (one per line)
  • The results of the script will be saved to /var/log/esx_disk_check_results.html
  • By default, the script will try to send the results by email using smtp_send.pl. You will need to update the last line of the script to include your email address, the desired from address, and your mail relay server. If you aren’t familiar with smtp_send.pl, you can find more info here.

I haven’t had the time, but there are a number of enhancements that could be made to this script (command line arguments, proper error handling, variable notification, etc.).

You can get the modified version of the script here.

tags: | |

2 Comments So Far

Duncan said:

Great work! Cool additions to my script!

Duncan

FREE Disk space monitoring solutions for VMware virtual infrastructure | VM /ETC said:

[…] and turned it into a centralized script to be run from a single Linux server. From the post Script - Checking ESX Disk Space Usage from a Central Linux Box: “The concept of the original script was to run the script locally on each ESX box through […]

Leave a Comment

Sponsors