Advertisement

news | articles | utilities | resources | about

snapalert.pl

snapalert.pl [download]

Snapshots are extremely useful to Virtual Machines, but keeping track of which VMs have snapshots can be problematic and/or time consuming. Snapshots that grow too large often degrade the I/O performance of the VM, lead to unbounded growth on the VMFS filesystem and can be difficult to commit when you decide you no longer need them. snapalert.pl is a perl script written to identify which VMs in your environement currently have snapshots so you can take appropriate action, it works with both ESX and ESXi as there is no console component. Additionally it can be configured to send the report to you via email so you won't have to remember to run it if you schedule the job.

To install, just copy this script to your RemoteCLI host, and then make the script executable:

vicfg:~# chmod +x snapalert.pl

You will then have to edit the script and modify the following variables to suit your environment:

###############################
#   Configurable Variables    #
###############################
my $username = '';
my $password = '';
my $url = 'https://vc.yourdomain.com/sdk';
my $email_alert_address = 'target.address@yourdomain.com';
my $email_from_address = 'source.address@yourdomain.com';
my $email_subject = 'Email Subject';
my $smtp_server = 'smtp.yourdomain.com';
###############################
#  End Configurable Variables # 
###############################

Then execute the script:

vicfg:~# ./snapalert.pl --verbose --email


Remember to test this process out on a development server. It has worked well for me and saved me lots of time, hopefully it will do the same for you. I am not responsible for your (mis)use of this script. If you have any comments or feedback feel free to drop me an email at dominic@vmprofessional.com.


 
Copyright © 2007 - vmprofessional. All rights reserved.