• Home
  • News
  • Technical Guides
  • Troubleshooting
  • Download
  • Videos
  • Top Bloggers!
  • About

VirtualVCP IT Virtualization

rynardtspies: Worst day on the job by far! 1 day ago from TwInbox

Script to Report ESX Snapshots PDF Print E-mail
User Rating: / 5
PoorBest 
Written by Rynardt Spies   
Thursday, 16 April 2009 12:33

This script will report all ESX Virtual Machine snapshots found on the SAN via email.

Download reportsnapshots.pl (Right-click, Save As)

WARNING: DO NOT EDIT THIS SCRIPT WITH WINDOWS NOTEPAD OR WORDPAD. If you would like to edit this script in Windows, please use a editor like Win32Pad. Notepad or Wordpad will corrupt the file for Unix/Linux use!

Installation Steps:

  • Use Veeam FastSCP or WinSCP to copy the script to one of your ESX hosts. Copy the script to /usr/local/bin/reportsnapshots.pl
  • Log onto the ESX server. The next steps should be done with root permissions.
  • Use vi or nano to edit the script. Enter the following information in relevant lines on the script:
    • Email recipient addresses that will receive email alerts
    • The Fully Qualified Domain Name or IP address of your mail server
    • If you need the script to control the ESX firewall, uncomment the #open_firewall() and #close_firewall() lines.
    • The rest of the script should work with the defaults.
  • Save the file and exit the editor
  • Make the file an executable: chmod +x /usr/local/bin/reportsnapshots.pl

 

To run the script at a given time, schedule a cron job:

The cron daemon can execute commands at a given time like Windows Task Scheduler does.

The format for a crontab line is:

|----------------------------------|| Minute
|  |-------------------------------|| Hour
|  | |-----------------------------|| Day of Month
|  | |  |--------------------------|| Month of Year
|  | |  | |------------------------|| Day of Week(0 - 6) (SUNDAY = 0)
* * * * * command to execute

To execute the reportsnapshots.pl script at a given time (this one is at 3pm every Monday to Friday), do:

[root@esx1 root]# crontab -e

Add the following line to the crontab file

00 15 * * 1-5 /usr/local/bin/reportsnapshots.pl

  • Add New
  • Search
  • RSS
Comments (0)
Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:D:angry::angry-red::evil::idea::love::x:no-comments::ooo::pirate::?::(
:sleep::););)):0
Security
Security Image
Please input the anti-spam code that you can read in the image.
Joomla components by Compojoom
< Prev   Next >
 
SocialTwist Tell-a-Friend

vmw-vcp_logo_260x40

vmw-vexpert_logo_223x40

 

View Rynardt Spies's profile on LinkedIn

 

Poll

ESX or ESXi in Production Environment?
 

What's the latest?

  • vSphere 4.1: VPXA Holds ESX Host at Ransom
  • Replacing vSphere SSL Certificates
  • The London UK VMware User Group Meeting on 15 July 2010
  • My thoughts on the VCDX Enterprise Admin Exam
  • New vSphere Patches Released on 10 June 2010

Popular

  • ESX 3i: Host in HA Cluster must have userworld swap enabled
  • ESX 3.5 on HP Proliant ML115 G5
  • VMware ESXi 3.5 on HP Proliant ML110 G5
  • Patching ESX 3.5 Using esxupdate
  • Cheap and quiet solution for a home-based ESX Server

Where Am I Today?

calendar_icon_s

Login to VirtualVCP

In order to leave comments, please log in.



  • Forgot your password?
  • Forgot your username?

Support VirtualVCP!

Information and Resources on this site are 100% free, however it costs money to run this site. Please help support this site by giving a donation.

Amount: 

RSS Feeds

VirtualVCP Virtualization Blog - ATOM Feed
VirtualVCP Virtualization Blog - RSS 0.91 Feed
VirtualVCP Virtualization Blog - RSS 2.0 Feed
VirtualVCP IT Virtualization, Powered by Joomla!; Joomla templates by SiteGround vBulletin hosting provider!

valid xhtml valid css