• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • Unexplored Territory Podcast
  • HA Deepdive
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

Checking for snapshots, html email report!

Duncan Epping · Feb 6, 2008 ·

When reading the VMTN forum I stumbled upon a topic about checking the VMFS for snapshots. Besides snaphunter by Xtravirt, which is an excellent script, there isn’t much out there. You can check the VirtualCenter database for snapshots but this way you would not notice the orphaned snapshots. (Orphaned snapshot occur when the vmsd file gets corrupted.) A couple of months before Xtravirt posted their script I wrote my own snapshot checking script named snapcheck.sh. You can easily schedule it via the crontab and if you have the MIME module in place and smtp_send.pl it will send an HTML email to you with a nice table, yellow line means a registered snapshot and red line means an orphaned snapshot. You should also have ssh key authentication in place, check for more info ssh key authentication the RTFM website. You can download the snapcheck script here! Enjoy it.

Related

Management & Automation, Server ESX, Scripting, service console, snapshots

Reader Interactions

Comments

  1. virtuel says

    22 February, 2008 at 19:00

    Thanks a lot for this post. I have been searching for something like this that could integrate directly into Virtual Center and notify groups when a scheduled snapshot is done/completed.

    I however need a lot of help with this script. I am very new to the linux world and not sure what needs to be installed where. I have downloaded the necessary files as you have mentioned but how do I install the MIME package on the esx host? Also in an environment with multiple ESX hosts would I have to then install this on all my hosts or is there a way to run this from just one central location and be notified?

    Thanks for all your help and sorry if the questions are basic

  2. Duncan Epping says

    22 February, 2008 at 20:11

    just copy the Lite.pm file from the MIME package to the described folder in the blog article. You can unzip the package with winrar or something like that and you can use a tool like WINSCP for copying to ESX.

  3. Jim Warren says

    3 March, 2008 at 17:10

    Thanks for the snapcheck.sh. I am using it now in place of snaphunter as a daily cron to monitor my vRanger snaps. I note that if I run the script ‘real-time’ I get the VMFS Volume usage stats however, if I run as a cron job, there isn’t any data? Thoughts?

  4. Patrick Sobau says

    12 March, 2008 at 09:15

    I had a similar problem with one of my scriptss (checks only disk space via VDF -h).
    When run as a cron you have to specify the path of vdf (/usr/sbin/vdf)
    Have fun

  5. ryno75 says

    21 June, 2010 at 22:13

    This is a nice script. I had to make a couple of mods to get it to work with ESX v4.0.0 Update1 due to changes in the vmware-cmd syntax. Apparently the “-q” option is no longer available??? No problem, just a little extra parsing…

    Here are the changes I made:

    42: VMNAME=`vmware-cmd -H ${esxhost}.${DNSDOMAIN} -U ${USER} -P ${PASSWORD} “$VMX” getconfig displayname | cut -d” ” -f 3-`
    43: SNAP=`vmware-cmd -H ${esxhost}.${DNSDOMAIN} -U ${USER} -P ${PASSWORD} “$VMX” hassnapshot | cut -d” ” -f 3`

  6. JamesC says

    24 September, 2010 at 14:50

    Has anyone managed to get this working with vSphere 4.1?

Primary Sidebar

About the Author

Duncan Epping is a Chief Technologist and Distinguished Engineering Architect at Broadcom. Besides writing on Yellow-Bricks, Duncan is the co-author of the vSAN Deep Dive and the vSphere Clustering Deep Dive book series. Duncan is also the host of the Unexplored Territory Podcast.

Follow Us

  • X
  • Spotify
  • RSS Feed
  • LinkedIn

Recommended Book(s)

Advertisements




Copyright Yellow-Bricks.com © 2025 · Log in