SnapHunter

February 25, 2009 — 1 Comment

Pearl Script for monitoring snapshots

Many VMWare admins may have experienced problems with VMWare snapshots specifcally when they become no longer visible in the VI Client. SnapHunter will create a report letting you know the status of snapshots on all your VM’s from the command line.

SnapHunter can be download from here >> http://engineering.xtravirt.com/products/phd-technologies/snaphunter.html

You will need to copy the tar.gz file to your server using something like WinSCP

To extract the tar type tar -zxf  snap_hunter.tar.gz

Now enter the folder that has been created and make the pearl scipt executable by running the following command chmod +x  snap_hunter.pl

You will now be able to execute the pearl script by running ./snap_hunter.pl

You will need to edit the config file in an editor like nano or VI to reflect your settings

To automate this you can run ./snap_hunter.pl -schedule, this will automaticlly create a crom job for you scheduled as you wish, for the username and password I would recommend you use a local administrator and password on your VC server.

One response to SnapHunter

  1. 

    Hi,
    I implemented snap_hunter on esx 3.5 but now, that we upgrade to vSphere 4.0u2, don’t work anymore.
    Script start running, and give some errors:

    cat: /vmfs/volumes/477dfcc1-5c0f635a-2022-0
    01e0b479632/vrsvgw/vrsvgw.vmx: Device or resource busy
    Use of uninitialized value in string at /usr/local/snap_hunter/snap_hunter.pl line 282.
    cat: /vmfs/volumes/477dfcd1-392d11d3-d725-001e0b479632/ced17/ced17.vmx: Device or resource busy
    ……
    ……
    Use of uninitialized value in numeric eq (==) at /usr/local/snap_hunter/snap_hunter.pl line 194.
    Use of uninitialized value in numeric eq (==) at /usr/local/snap_hunter/snap_hunter.pl line 87.
    Use of uninitialized value in numeric eq (==) at /usr/local/snap_hunter/snap_hunter.pl line 89.
    Search completed successfully. No VMs were found to currently have snapshots.

    That VMs don’t stand on the host where I running snap_hunter. Also when I look for crontab job, created by “snap_hunter.pl -schedule” with user root, I can’t find it. I tried with a snapshot in a vm, and email still don’t work.

    ….

    [evavmfs04]vsrvgpre/vsrvgpre has at least one active snapshot

    VM DISK REPORT:
    vsrvgpre.vmdk has 1 snapshot layers.

    Delta name: vsrvgpre-000001.vmdk
    Snapshot creation date: Nov 4 09:37
    Delta size: 17MB
    vsrvgpre_1.vmdk has 1 snapshot layers.

    Delta name: vsrvgpre_1-000001.vmdk
    Snapshot creation date: Nov 4 10:05
    Delta size: 42KB

    VM SNAPSHOT DETAILS:
    Current snapshot SsId is not available unless you specify a hostname, username and password.
    Current snaphot name: TestSnapHunter

    ….

    Any idea?
    thanks

    vSphere Host is 4.0.0 Update 2 build 261974

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s