VMware Health Check Report v0.9.5

VMware Health Check Report v0.9.5

Description:

This script generates a health check report of all attributes pertaining  to a single ESX/ESXi 3.x+ host or VMware vCenter and its managed  entities (i.e. clusters and individual ESX/ESXi 3.x+ hosts). The  generated report is based off of some earlier Powershell script

work created by

Ivo Beerens/

Duncan Eppping.

I was primarily motivated on this project because it allowed me to start  learning about how to utilize the VI API through the VI Perl Toolkit.  Existing information provided by the RCLI and VI Perl Toolkit default  utilities are useful though they can be limited. This gave me an  opportunity to learn how to write my own Perl scripts that may  ultimately lead to more functional tools that the community as well as  VI administrators can utilize.

The generated health check report contains most of what Ivo Beerens has  included in his latest release. For this project, I am attempting to  create a non-Powershell solution as opposed to the direction taken by  Ivo and Duncan. This Perl script will generally be a work in progress as  I continue to learn about the API. Moreover, I hope that this will be  something of use to administrators especially those seeking to query  important pieces of information such as VM(s) containing snapshots  and/or RDM(s).


The script reports on the following:

  • vCenter Build/Release
  • License summary
  • Active Sessions
  • ESX/ESXi Build/Release
  • Cluster(s) Name/Statistics (Hosts,CPU and MEM availabity, HA,DRS and DPM enabled, Resource Pools, Health)
  • ESX/ESXi Hardware configuration (NICs/HBAs)
  • ESX/ESXi Hardware Health Sensor via CIM
  • ESX/ESXi State
  • ESX/ESXi Configurations (for detailed information, use detail-hosts option)
  • ESX/ESXi Multipathing Info (only available in host or detail-hosts option)
  • ESX/ESXi Datastore summary
  • ESX/ESXi LUN summary
  • ESX/ESXi Portgroup summary
  • ESX/ESXi Hostd logs
  • CDP Summary
  • Recent Tasks
  • Virtual Machine summary
  • VM Storage summary
  • VM Network summary
  • VM w/Snapshots
  • VM w/Snapshot delta age
  • VM w/RDMs
  • VM w/NPIV enabled
  • VM w/connected CD-ROMs
  • VM w/connected Floppys

For more details, please take a look at the sample reports located

here and

here

Requirements:

Usage

[vi-admin@vima-primp-industries ~]$ ./vmwareHealthCheck.pl
Required command option 'type' not specified.

Synopsis: ./vmwareHealthCheck.pl OPTIONS


Command-specific options:
   --cluster
      The name of a vCenter cluster
   --datacenter
      The name of a vCenter datacenter
   --logcount
      The number of lines to output from hostd logs
   --report
      The name of the report to output
   --type (required)
      Type: [vcenter|datacenter|cluster|host|detail-hosts]


Common VI options:
   --config (variable VI_CONFIG)
      Location of the VI Perl configuration file
   --encoding (variable VI_ENCODING, default 'utf8')
      Encoding: utf8, cp936 (Simplified Chinese), iso-8859-1 (German), shiftjis (Japanese)
   --help
      Display usage information for the script
   --passthroughauth (variable VI_PASSTHROUGHAUTH)
      Attempt to use pass-through authentication
   --passthroughauthpackage (variable VI_PASSTHROUGHAUTHPACKAGE, default 'Negotiate')
      Pass-through authentication negotiation package
   --password (variable VI_PASSWORD)
      Password
   --portnumber (variable VI_PORTNUMBER)
      Port used to connect to server
   --protocol (variable VI_PROTOCOL, default 'https')
      Protocol used to connect to server
   --savesessionfile (variable VI_SAVESESSIONFILE)
      File to save session ID/cookie to utilize
   --server (variable VI_SERVER, default 'localhost')
      VI server to connect to. Required if url is not present
   --servicepath (variable VI_SERVICEPATH, default '/sdk/webService')
      Service path used to connect to server
   --sessionfile (variable VI_SESSIONFILE)
      File containing session ID/cookie to utilize
   --url (variable VI_URL)
      VI SDK URL to connect to. Required if server is not present
   --username (variable VI_USERNAME)
      Username
   --verbose (variable VI_VERBOSE)
      Display additional debugging information
   --version
      Display version information for the script

Supported Use Cases:

1) This will collect information about all cluster(s)/host(s) providing vCenter Server:

./vmwareHealthCheck.pl --server VC_SERVER --username VC_USERNAME --password VC_PASSWORD --type vcenter

2) This will collect information about a specific datacenter provided with vCenter Server:

./vmwareHealthCheck.pl --server VC_SERVER --username VC_USERNAME --password VC_PASSWORD --type datacenter --datacenter DATACENTER_NAME

3) This will collect information about a specific cluster provided with vCenter Server:

./vmwareHealthCheck.pl --server VC_SERVER --username VC_USERNAME --password VC_PASSWORD --type cluster --cluster CLUSTER_NAME

4) This will collect information about a specific host provided with ESX/ESXi Server:

./vmwareHealthCheck.pl --server ESX_ESXi_SERVER --username ESX_ESXi_USERNAME --password ESX_ESXi_PASSWORD --type host

5) This will collect detail information about all ESX/ESXi hosts under  vCenter (for datacenter/cluster specific, please look at option 1-3).

This option is meant to provide a report similiar to that of

esxhealthscript within the capablities of the VI API utilizing the VI Perl Toolkit. For  a high level view of your VMware environment, please use the other  options, as this pertains to detail configurations of your hosts.

./vmwareHealthCheck.pl -server VC_SERVER --username VC_USERNAME --password VC_PASSWORD --type detail-hosts

To specify the number of the latest lines in the hostd logs, use --logcount

number_of_lines

(e.g.)

./vmwareHealthCheck.pl -server VC_SERVER --username VC_USERNAME --password VC_PASSWORD --type detail-hosts --logcount 20

Custom Configurations

Edit the following at the top of the script to configure the warning  levels for the various resource consumptions (disk,memory,cpu):

####################################
#
resource consumption warnings
####################################
#
yellow < 30 %
my $yellow_warn = 30;

#
orange < 15 %
my $orange_warn = 15;

#
red < 10%
my $red_warn = 10;

Edit the following at the top of the script to configure the number of days aged for a snapshot delta file:

######################################
#
vm snapshot age warnings
######################################
#
yellow < 15 days
my $snap_yellow_warn = 15;

#
orange < 30 days
my $snap_orange_warn = 30;

#
red < 60 days+
my $snap_red_warn = 60;

Changes

##########################################################################

03-24-2009 - v0.9.5

Fixes:

-Updated code to properly handle Recent Tasks section in case one of the fields do not exists

Info:

-This script will no longer recieve new features, I'll continue to  maintain for bug fixes/etc. All new development will be focused on the  vSphere version of the script at -

VMware vSphere Health Check Report v4.1.4

##########################################################################

03-24-2009 - v0.9.4

Fixes:

-There was a bug reported by Duncan Epping and others regarding hosts  that were appearing in the wrong cluster with respect to the portgroup  listings, this should be fixed.

Enhancements:

-Detail Hardware Health sensor readings provided by CIM

-CDP Summary (individual

cdp.pl available)

##########################################################################

02-28-2009 - v0.9

Fixes:

-Due to VMware API bug, the VMDK count per VM is not displaying correctly, a work around has been setup to print # of disks

Enhancements:

-Retrieve script version by using --version

-Cluster Health

-Recent Tasks

##########################################################################

02-11-2009 - v0.8

Fixes:

-Fixed an issue where disconnected VM(s) may cause the script to halt

Enhancements:

-Added hostd logs with --logcount flag to specify the last number of lines (default 15 lines)

-Performance enhancement, script should execute much faster (YMMV)

Example report

here

##########################################################################

02-09-2009 - v0.7

Fixes:

-Removed invalid cluster stats (output was not regarding consumption but availablity)

-Fixed an issue that may allow the script to execute on Windows VI Perl Toolkit again(no guarantees)

Enhancements:

-Licensing/features information

-Active Sessions

-ESX UUID

-Additional ESX/ESXi host configurations (available with

host or

detail-hosts flag)

-Performance increase on script execution (YMMV)

-Added

detail-hosts flag which provides additional host configurations (comparable to

esxhealthscript)

  • VMotion enabled
  • Service Console network summary
  • VMkernel summary
  • DNS
  • Offload capabilities
  • Diagostic Partition
  • vswif summary
  • vSwitch/cdp summary
  • Firewall known services
  • ...much more

Example report

here

##########################################################################

02-05-2009 - v0.6

Fixes:

-Fixed minor typographic errors

-Fixed issue if no additional hardware vendor information is available

-Fixed potential issue with displaying information about datastores not being accessible

Enhancements:

-Display snapshot deleta file(s) age (options configurable by users)

-Display

root resource pool information if appliacable

##########################################################################

02-04-2009 - v0.5

Fixes:

-Cleaned up a little of the html structure

-Fixed issue when no ntpServers configured

-Fixed issue when VMware tool status is not available

-Fixed the order of the Adv options

-Fixed Host to Datastore access (If a datastore is presented to hosts  that reside in separate clusters, false positives may be included in the  output)

Enhancements:

-Added support for --datacenter argument for specifying a specific datacenter in vCenter

-Additional hardware info (possibly AssetTag if configured)

-Display Adv options: Disk.SchedNumReqOutstanding and NFS.LockDisable

##########################################################################

02-01-2009 - v0.4

Fixes:

-Only display summary on valid clusters (w/hosts attached)

Enhancements:

-Display hosts in cluster with inconsistent storage presentation

-Display hosts in cluster with inconsistent portgroup configurations

-Display Disk.UseDeviceReset

-Display Disk.UseLunReset

##########################################################################

02-02-2009 - v0.4

Fixes:

-Fixed color output to highlight the correct values

-Fixed the output of the script execution time to output correct time format

Enhancements:

-Display MB,GB,TB and MHz,GHz instead of just (MB,MHz)

-Display cluster resources % free

-Display hosts in cluster with inconsistent LUN access


TO-DO/WIP

-None atm

Known Issues

1) Firewall information is limited to only known and blessed services, this is a limitation of the VI API

2) Multiple Service Console interfaces may not display correctly

3) SNMP infor (may or may not work)

Comments

William: I'm probably dumber than a post but I've just started using VIMA and I've downloaded your script to VIMA. When I execute it on VIMA I get a "cannot load Win32::OLE: Can;t locate Win32/OLE.pm in @ INC" error thrown by the VIMA PERL setup. Am I missing something?

I'm not sure why you're seeing that error. You should be able to just import the latest VIMA virtual appliance into your VMware Infrastructure and use the script, so long as you satisfy the basic requirements. If you have any issues with VIMA, I would suggest posting in the VIMA forums: http://communities.vmware.com/community/developer/vima

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

William:

Shall do. It is the latest VIMA version and it seems to be pulling data correctly using other scripts. I'm also going to try the script directly from the Perl Toolkit under Windows. As I said, I'm absolutely new to all of this so I'm proabbly doing something boenheaded stupid right up front.

Robert

Good Luck. Btw, the script was developed purely in VIMA and on the VI Perl Toolkit under VIMA ... I make no claims it'll be 100% functional in the Windows VI Perl Toolkit, though it should but could see some differences if their active Perl doesn't contain certain modules I use.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Hi,

I'm using it with the latest VIMA (downloaded today) but the script terminates with the following message:

"Can't call method "val" on an undefined value at ./vmwareHealthCheck.pl line 442"

Report file has been written but it was cut in the "Virtual Machines" section at the second VM.

daniel

Great script!

But somehow the data in an array gets screwed up under the section "#advconfigs". It gets sorted somehow which is causing the table not to show the right values.

Alternatively i changed:



Into:

LVM.EnableResignature

LVM.DisallowSnapshotLun

Disk.UseDeviceReset

Disk.UseLunReset

Disk.UseDeviceReset

Disk.UseLunReset

LVM.EnableResignature

LVM.DisallowSnapshotLun

and now the table is showing the right (expected) values.

Also to be more clear in the report i changed "YES" : "NO" into "Enabled (1)" : "Disabled (0)" for these four items.

I've got one error:

D:\Downloads>vmwareHealthCheck.pl --server server --username user --password pass --type vcenter

Generating VMware Health Report "report.html" (this can take a few minutes depending on environment size. Get a cup of c

offee/tea and come back) ...

Can't call method "ntpConfig" on an undefined value at D:\Downloads\vmwareHealthCheck.pl line 992.

End Disconnect

without that ntp stuff the script is running fine. thanks...

Hi pfuhili,

Thanks for the catch, there are certain params/configs that if not defined will cause this error. I've tried to catch and check all variables prior to printing but there are some that I've probably missed. I'll make sure that line gets fixed in the next release tonight.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Hi bosma115,

I noticed a similar issue while adding an additional parameter, the logic for that section will be fixed as it matches the keys in alphabetical order and should follow that with the table printout. I'll get a fix for this and hopefully in tonight's new release of the script.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Hi s.buerger,

As mentioned in the reply to pfuhli, I'll check the value prior to printing and hopefully get that fix in tonight's release.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Hi lamw,

I don't know if you've seen this script, but it might give you a few good ideas:

http://sourceforge.net/projects/esxhealthscript

Thanks for all the hard work so far, Forbes.

Forbes Guthrie

http://www.vreference.com

Hi forbes,

Yes, Mr. Duncan Epping has made me aware of that script. I've yet to fully dissect what is really useful out of that output as you can see it's very extensive. I don't know if that is the level of detail most consultants or end users going into a new or existing environment would like to see? I know in past work for legacy migrations, some of that data is useful and I've taken what I had to extract in the past and integrate into my report. Also not all information from that health report which is actually executed on the ESX 3.x+ w/Service Console (no support for ESXi if I recall) is available in the API.

I'm interested in feedback from those that have been able to execute the script on what information is useful or would be nice to have as a high level report.

Thanks for the comments and I'll have an update for some fixes/enhancements later this evening, look out for that.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

I like that particular script for 2 reasons:

- gives a good overview of general server health (things like the log tails)

- gives a very detailed list of how the server is configured. Like most people, I don't backup ESX hosts themselves. With the output from that shell script, I can rebuild it (network settings, vSwitch configs, NTP settings, disk partitioning, patch level, firewall settings, etc). It also helps to highlight misconfigurations across servers.

I like it because it is host centric. Most of its output is just echoing or grepping text files, or esxcfg commands.

You have a couple of big advantages here. You are actively maintaining this script (the other one hasn't been updated in a while) and you can query several hosts at once using VIMA and VirtualCenter. A lot of the current PowerShell scripts do a good job of collating the VirtualCenter and cluster information, but miss out on the detailed ESX host information. I understand that most consultants want something they can run, to produce a report on the overall setup to give a customer. However, as an administrator of dozens of hosts, a more detailed report can be very useful. For the linked shell script, you have to set this up on every server with their own cron job, etc. If your script could cycle through every host connected to VirtualCenter and produce detailed reports like this, I would love it. Perhaps you could add a "detailed" switch to the script, which would produce far more information about each host.

Anyway, that's just my 2 cents. Great job so far, Forbes.

Forbes Guthrie

http://www.vreference.com

forbes,

Thanks for the input. I'll definitely take a look to see what I can collect, though one issue I'm starting to face is performance of the script. I've been given some options to help speed things up which is related to searching for orphan snapshots.

I agree with reason #1, but #2 should be easy if you use a scripted install process. I've supported a pretty large environment in the past and even deploying 20+ host at a given moment and if you have all those changes within say a kickstart, then keeping the hosts consistent should be trivial. It does require you to keep up to date with all the scripts, as new releases or patches are introduced into the environment. Though with careful subversion control and lots of Q/A, keeping builds consistent is definitely possible even for the small or large enterprises.

I know VMware is introducing host profiles in the next VI release, and it won't solve all issues it will help mitigate some of the basic issues like vswitch/portgroup/cluster configurations. I agree, as an Admin, I do like to see the details of the server. Though ... the days of the SC will only last for so long, at least it's been said it'll stay in the next VI release Smiley Wink

VIMA is really where the next level of management will be at and using remote tools like the RCLI or VI Perl Toolkit, whether we like it or not. I think it's definitely a great idea and I'm all for it, so long as the environment of the SC is replicated as closely as possible.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Hello,

thanks for the great work. I've tested the script and it works very good.

I've one question: Which permissions are required in VirtualCenter to collect the informations.

It would also be nice to be abled to view output like you get from esxcfg-mpath -l to see information about paths and settings.

I believe read-only should work but you'll have to verify. I've been using my admin account to run the reports.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Great - you keep up the good work!!

It runs through w/o errors.

some suggestions for nice-2-haves Smiley Wink

- resource pool metrics (limits and reservations vs. sum of RAM and CPU of all VMs attached to this pool)

- weblizer like stats (index page which links to everyday reports)

v0.6 just released.

I'm interested to all those that have tried the script, how long it took the script to execute and approx. how large is your environment (hosts/vms).

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Hi William,

we have 2 VC instances. Here are the numers:

VC2:

- 1 cluster

- 3 hosts

- 129 VMs

Generating VMware Health Report "report.html" (this can take a few minutes depending on environment size. Get a cup of coffee/tea and come back) ...

Use of uninitialized value in print at ./vmwareHealthCheck.pl line 941.

Use of uninitialized value in print at ./vmwareHealthCheck.pl line 941.

Use of uninitialized value in print at ./vmwareHealthCheck.pl line 941.

Start Time: 02-06-2009 09:20:33

End Time: 02-06-2009 09:39:27

Duration : 18.9 Minutes

VC1:

- 2 clusters

- 7 Hosts

- 209 VMs

Generating VMware Health Report "report.html" (this can take a few minutes depending on environment size. Get a cup of coffee/tea and come back) ...

Use of uninitialized value in print at ./vmwareHealthCheck.pl line 941.

Use of uninitialized value in print at ./vmwareHealthCheck.pl line 941.

Start Time: 02-06-2009 09:57:37

End Time: 02-06-2009 10:18:52

Duration : 21.2 Minutes

v0.6 don't work on win32 anymore:

my $todays_date =`date +\%Y-\%m-\%d`;

with this line perl opens a new process cmd.exe... that don't close...

ntpconfig-failure still there:

Can't call method "ntpConfig" on an undefined value at D:\Downloads\vmwareHealthCheck_001.pl line 1113.

runtime:

vmwareHealthCheck.pl --server server --username user --password pass --type vcenter

Generating VMware Health Report "vmware_health_report.html" (this can take a few minutes depending on environment size.

Get a cup of coffee/tea and come back) ...

Start Time: 02-06-2009 12:53:29

End Time: 02-06-2009 12:55:20

Duration : 1.9 Minutes

(1 Cluster, 2 Hosts, 100 VMs)

Thanks for your great work, William!

But the Cluster ressources aren't correct.

effectiveMemory/CPU is not the actual usage. Thats the amount of the ressources wich is usable for VMs.

You have to use the quickStats from all hosts in the cluster.

esxcfg-mpath -l is a good idea for upcomming releases.

Thanks for the info, also I see you're using the old v0.5, the additional vendor information should be fixed in v0.6 so you should not see that error regarding that print statement anymore.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Sorry to hear the new version v0.6 is not compatible with Windows, again this was more of a surprised that it worked on Windows but no guarantees are put in place to ensure it'll continue to operate on Windows. I've developed the script fully on VMware VIMA which is a RHEL environment and I'm using the default Perl environment that's been setup which I assume should match pretty close to the active state Perl installed on Windows but I can't say 100%. I would encourage you to give VMware VIMA a try and it's pretty easy to get up and running as a virtual appliance not only this report but for other CLI management utilities that are not available on Windows.

You have the option of using VIMA or if you choose to continue on Windows, your only option is to continue using v0.5 or comment the following lines out: 761-785

Regarding your NTP conflict, I've tested this on a newly build ESXi 3.5u3 with no NTP configurations and I did not run into this issue, I'll take another look but is there any reason why you don't have NTP configured? It's probably a good idea to keep proper time sync with regards to authentication, proper event logging, etc.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Thanks for the confirmation, I had a hunch it was not listing the actual consumption, hence it was noted as a possible issue. I'll have those stats removed/reworded in the next release as I don't get into the hosts info until after I retrieve the cluster statistics, in which I do provide quickStats information pertaining to each hosts.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Yep your right, the cluster stats runs first.

To make that work i've made a new helper function

who asks for the mem und cpu usage through quickstats.

It's a bit dirty but works. I've also added the number of VM's in the cluster

to my report.

Again, great work!

I forgot to mention, can you try making the following modification to the script to see if it fixes your NTP issue:

Change the following line to:

line 1113:

if($local_host->config->dateTimeInfo)

Let me know if that works

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

v0.7 released.

This update has some major new features, check it out and let me know if you run into any issues.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Hi William,

we have two VC instances. I want to run the script against these both at the same time. Therefore it would be fine if the reportname could be specified by a param or if the file would be named by the script to something related to the VC instance.

Do you think it would be possible to implement that?

Regards,

daniel

BTW: performance has been improved a lot!!

VC1:

- 2 clusters

- 7 Hosts

- 209 VMs

Start Time: 02-11-2009 08:13:55

End Time: 02-11-2009 08:26:44

Duration : 12.8 Minutes

I have managed to get the script to run ok, however...

The output *.html gets produced and gets as far down as ESX/ESXiDatastore(s): of which I have around 10.

The report outputs 3 and on the 4th one it stops. The script keeps running however it is oviously outputting nothing and running the cpu at 90% on the machine im running the viperltoolit on.

The output in the report gets to the "free" collum and outputs the following: 416.47 GB</

Its seems like it has output some code that it shoudlnt "</".

Has anyone else seen this?

Ive tried looking at the code my self but im a beginner programmer and am stuggling to pick it out.

pfuhli, actually if you take a look at the usage options you'll see that you have an option to specify the report name. If you're looking to loop through say 20 vCenter instances (lets just say you have that many), you can quickly write a quick shell/perl script and just change the name of the report based in the input of your vCenter server.

So yes, this is possible (e.g.)

./vmwareHealthCheck.pl --server VC_SERVER --username VC_USERNAME --password VC_PASSWORD --type vcenter --report my_report_vcenter_name.html

will generate the report named report my_report_vcenter_name.html

I'm glad performance has improved, there may be more in the next release

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Hard to say what the issue could be. I actually ran into an issue myself while trying to access a datastore that was not accessible as it was under some maintenance which I ended up fixing. I would just check to make sure your datastore's are accessible. Usually the script will error/warn if it can't reference a specific VI object, if it continues to process then perhaps it was not able to extract the data.

Also double check that you're running the latest VI Perl Toolkit, are you executing this on a Windows or Linux system? If you have some time, could you try using VIMA to execute this? Curious if the issue lies in the release of VI Perl Toolkit or if there's some exception I'm not catching.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Evening,

v0.8 just released. This update was mainly for performance and added Hostd logs output.

Let me know what you guys think or if you run into any issues

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

it's a lot faster, it used to take over an hour for 50+ hosts, now only 20 minutes!

Duncan

Blogging: http://www.yellow-bricks.com

If you find this information useful, please award points for "correct" or "helpful".

That's awesome to hear Duncan! I'm really happy I learned about those property filters (wish it was documented in the guides), definitely cuts back on the amount of information transferred and just gives me exactly what I want.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

As it happens im already using the latest VIMA. So that should have the most up to date viperltoolkit. I have even downloaded your latest version of the script and still it halts at the exact same point. I have created my own script that pull data from all datastores in the datacentre and it seems to work without any issue.

I know its not much help without a error message but im just not seeing anything come back. It seems to have gotton its self into a loop somehow as it is still doing somthing. I left it overnight to see if it was just taking a long time on my system but still nothing.

Would it be possible in one of your next releases to build in a debug switch so I could see exactly were the script is getting confused?

disregard my last comment. it is working with the new version. thanks

Really great script!

I found some log errors on a esxi host (3.5.0 143129) while running the scripts, is this something i should worry about??

thanks in advance

Feb 23 09:39:55 Hostd: Activation : Invoke done on

Feb 23 09:39:55 Hostd: Throw vim.fault.FileFault

Feb 23 09:39:55 Hostd: Result:

Feb 23 09:39:55 Hostd: (vim.fault.FileFault) { dynamicType = , file = "Device or resource busy", msg = "" }

Feb 23 09:39:55 Hostd:

Feb 23 09:39:55 Hostd: DISKLIB-VMFS : "/vmfs/volumes/4990037b-0b5444fb-3fe9-00151780605d/oracle2/oracle2_1-flat.vmdk" : failed to open (1048585): AIOMgr_Open failed. Type 3

Feb 23 09:39:55 Hostd: DISKLIB-DSCPTR: Failed to open extents for descriptor file in normal mode

Feb 23 09:39:55 Hostd: DISKLIB-LINK : "/vmfs/volumes/4990037b-0b5444fb-3fe9-00151780605d/oracle2/oracle2_1.vmdk" : failed to open (Device or resource busy).

Feb 23 09:39:55 Hostd: DISKLIB-CHAIN : "/vmfs/volumes/4990037b-0b5444fb-3fe9-00151780605d/oracle2/oracle2_1.vmdk" : failed to open (Device or resource busy).

Feb 23 09:39:55 Hostd: DISKLIB-LIB : Failed to open '/vmfs/volumes/4990037b-0b5444fb-3fe9-00151780605d/oracle2/oracle2_1.vmdk' with flags 0x6 (Device or resource busy).

Feb 23 09:39:55 Hostd: Failed to open '/vmfs/volumes/4990037b-0b5444fb-3fe9-00151780605d/oracle2/oracle2_1.vmdk' : Device or resource busy (1048585).

Thanks for the great script

May have found a bug when reporting snapshot deltas. If 18 VMs are found with snapshots and each of those VMs have 2 deltas older than the defined number of days I would expect 36 entries in the delta info table. The current script v.08 only displays information for 18 deltas in the delta info table.

Also, I am a Perl novice, how are you populating the vm_delta_warn array?

No you should be fine, I assume you either used host or the undocumented vmfrag option? In any case, this was something I was playing around with but realized the VMDK fragmentation is only available on sparse VMDK(s). Also this information can only be queried while the VM is powered off, hence you're seeing those errors in the hostd.log when it runs the "queryVirtualDiskFragmentation* function. I may or may not be removing this in a future update as it's only pertaining to sparse files, not sure how useful it would be. So nothing you need to worry about

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Hm, I'll have to do some investigation, I'll try changing the yellow warning of 1day and take two snapshots and see if it's listing properly. You should also be able to see your two snapshots in the table above? I would just double check that the actual captured time is indeed beyond the defined number of days.

If you take a look at line starting at 998, you'll see how I'm extracting the information. This is using the datastore browser and creating a search spec for files that end with *-delta.vmdk, you can always find more information looking at the VI API, it's definitely a fun task to go through if you have some time.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Actually, come to think of it, we do have a test VM that has two snapshots taken on the same day and it is listing properly. I would definitely take a look at the timestamp of the snapshots to ensure they're beyond the defined days.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Hi William, I double checked timestamps this morning, there are several deltas from 2007 that are not displaying. Also, some of the VMs have up to 7 vmdks. One VM has a delta over 20GB in size (I have only just started working on this environment), not sure the size may cause an issue. I will do some further testing this afternoon.

Yea, I'm not too sure, this data is being returned by the API. You can always take a look at the section on where it retrieves all the *-delta.vmdk and print them out to see if it's seeing them initially. This should help determine if it's the logic in checking the dates or the API isn't seeing the deltas at all.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

I am using host option, thanks a lot for the very detailed answer!

max

I'm a newbie at this. when I run the script: ./vmwareHealthCheck.pl --server server_name --username server_username --password server_password --type vcenter datacenter_name, it only reports on who is logged into Virtual;Center, no data on the datacenter n question.

Please take a look at the usage samples, if you're looking at drilling down into datacenter you need to use the following flags:

--type datacenter --datacenter DATACENTER_NAME

I believe the only thing I extract out of the datacenter is the name, it will require you to have a cluster for further details of your environment.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

I don't have any of our esx hosts in a cluster. So, I will not be able to extract any data then?

No data will be extracted, usually with a cluster you have the finest level of granularity and carving of your resources. If you still want information, you can run the --host which allows you to look at an individual host and you can run the report on each individual host.

You're more than welcome to modify the script so it doesn't output cluster information if you're looking at the datacenter, but that'll be something you'll need to modify to fit your environment. If you don't want to take advantage of DRS/HA/DPM within a cluster, you can just create a cluster and disable all those features. The cluster would just act as a logical grouping, it will not affect your hosts in any way unless you enable features within the cluseter.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

Sorry if I'm a bit confused - perhaps I should just try the script and see what happens...

Do I evoke this from my Windoze PC with PowerShell?

Do I copy this to the VIMA and evoke it there? (preferred)

How do I get the nifty HTML output pages referenced on the scripts homepage? (seems that it's inherent - but just wondering if I evoke it on the VIMA where the files end up)

I'd also add - it would be a nice touch for the HTML output to include the command syntax that was used to generate the file.

Version history
Revision #:
1 of 1
Last update:
‎01-30-2009 04:35 PM
Updated by: