VMware vSphere Health Check Report v5.1.0

VMware vSphere Health Check Report v5.1.0

Table of Contents

  • Author

  • Description

  • Sample Report

  • Requirements

  • Usage

  • Setup

  • Supported Use Cases

  • Additional Commandline Options

  • Custom Report Configuration

  • Setup & Run Health Check Script on Windows

  • Change Log

Author

William Lam

-


Description:

This script generates a health check report similar to that of vmwareHealthCheckScript but for the new vSphere release of VMware ESX(i) 4.x/5.x and VMware vCenter 4.x/5.x and it's managed entities. User's can now fully customize the report based on the categories that are of importance to their operating environment, including selecting specific set of ESX(i) hosts and/or Virtual Machines.

The script reports on the following:

  • New vCenter Information including InstanceUUID and hostname
  • New Storage DRS Configuration
  • New FDM/HA Heartbeat Policy and State
  • New Host details (Host Agent, iSCSI, FCoE, Source Packages, Capablities, SMC Hardware, Host Cache, DVS)
  • New Virtual Machine details (HW Version, Firmware, Overhead Memory, Swap, State, Snapshot Consolidation, HA Protection, EZT Disks)
  • New updated Color mappings for mulitpath states
  • New Support for Standalone ESX(i) hosts without vCenter Cluster
  • New updated Color scheme for HTML Report
  • DRS GROUP/VM Rules
  • HA Configuration Issues
  • COS VMDK Information
  • Storage I/O COntrol Information
  • Host Authentication Services
  • VM count per datastore
  • VM count / VM-to-Host Ratio in Cluster Section
  • Report is now completely modular in which categories to display via a configuration file

  • Report can be configured to output as printer friendly format

  • Ability to specify specific ESX/ESXi host to query

  • Ability to specify specific Virtual Mchines to query

  • vCenter HA Advanced Runtime information

  • vCenter HA Configuration (primary/secondary and node states)

  • vCenter HA Advanced Configurations

  • vCenter DRS Advanced Runtime information

  • vCenter Resource Pool CPU/MEMORY shares

  • vCenter Plugin information

  • ESX/ESXi IP/HOSTNAME of vCenter Management IP

  • ESX/ESXi Newly improved Hardware and System Health Stuats information

  • ESX/ESXi Advanced Configurations

  • ESX/ESXi NUMA information

  • ESX/ESXi Datastore VMFS block size + version

  • ESX/ESXi Host capabilities

  • ESX/ESXi Lockdown Mode information

  • VM UUID,Bootime,Resource Statistics, Fault Tolerance, Thin provisioned and NPIV information

  • VM Resource Allocation information

  • VM Device information

  • Supports multiple email recipients

  • vCenter VPX Configurations summary

  • VMware Applications running in a VM

  • vCenter Managed IP per ESX(i) host

  • vCenter User/Group Permissions

  • Added Host & SCSI LUN Model attribute

  • Added Host boottime

  • Additional LUN Mapping information including Datastore,VolumeUUID,DiskName and DeviceName

  • VM portgroup + dvportgroup mapping

  • Performance Stats for both Cluster + Hosts (cpu/mem avg + %)

  • Performance Stats for VM (cpu/mem avg + %, ready & ballon)

  • Email report capability

  • Added additional command line options for including Cluster,Host and VM Performance stats (default: off)

  • New licensing format/summary

  • EVC Enabled information

  • Cluster VM monitoring

  • Cluster Host monitoring}

  • # off VMotions within a cluster

  • Datastore uncommitted info

  • CPU power management info

  • VM info (FT, Record/Replay, Clean Poweroff)

  • Host IPv6, FT, SSL Thumbprint

  • Host Profiles

  • vApp information

  • Distributed vSwitch information}

  • vCenter Build/Release

  • 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


Sample Report

For more details, please take a look at the following sample report: here

Issues/Feature Request

Please join the vSphereHealthCheck Group to post comments/discussions


Requirements:


Usage

[vi-admin@scofield ]$ ./vmwarevSphereHealthCheck.pl
Required command option 'type' not specified.

Synopsis: ./vmwarevSphereHealthCheck.pl OPTIONS


Command-specific options:
   --cluster
      The name of a vCenter cluster to query
   --clusterperformance (default 'no')
      Enable Cluster Performance gathering [yes|no] (Can potentially increase your runtime)
   --conf
      File containing Host and VM specific configurations to output
   --datacenter
      The name of a vCenter datacenter to query
   --demo (default 'no')
      [yes|no]
   --email (default 'no')
      [yes|no]
   --hostlist
      File containting list of ESX/ESXi host(s) to query
   --hostperformance (default 'no')
      Enable Host Performance gathering [yes|no] (Can potentially increase your runtime)
   --logcount (default '15')
      The number of lines to output from hostd logs
   --printerfriendly (default 'no')
      Whether the html output will be printer friendly [yes|no]
   --report (default 'vmware_health_report.html')
      The name of the report to output. Please add ".html" extension
   --type (required)
      Type: [vcenter|datacenter|cluster|host]

   --vmlist
      File containting list of VM(s) to query
   --vmperformance (default 'no')
      Enable VM Performance gathering [yes|no] (Can potentially double your runtime)

Common VI options:
   --config (variable VI_CONFIG)
      Location of the VI Perl configuration file
   --credstore (variable VI_CREDSTORE)
      Name of the credential store file defaults to <HOME>/.vmware/credstore/vicredentials.xml on Linux and <APPDATA>/VMware/credstore/vicredentials.xml on Windows
   --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

-


Setup

1. Download the packaged script vmwarevSphereHealthCheck.tar.gz and transfer it to your vMA host

2. Extract the contents:

[vi-admin@scofield ~]$ tar -zxvf vmwarevSphereHealthCheck.tar.gz
vmwarevSphereHealthCheck/
vmwarevSphereHealthCheck/vmwarevSphereHealthCheck.pl
vmwarevSphereHealthCheck/healthCheck.conf

3. You should now have a directory called vmwarevSphereHealthCheck and the script is located inside with a sample configuration file

4. If you decide to create a custom user to run this script, ensure the user has a minimum of the following permissions:

Datastore.Browse
Global.Diagnostics
Global.Licenses
Sessions.TerminateSession
Sessions.ValidateSession
System.Anonymous
System.Read
System.View


Supported Use Cases:

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

./vmwarevSphereHealthCheck.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:

./vmwarevSphereHealthCheck.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:

./vmwarevSphereHealthCheck.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:

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

-


Additional Commandline Options:

Use a configuration file

./vmwarevSphereHealthCheck.pl --server VC_SERVER --username VC_USERNAME --password VC_PASSWORD --type vcenter --conf healthCheck.conf

Please take a look at the sample healthCheck.conf configuration file attached down below

Specify specific ESX/ESXi hosts to query

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

where hostlist can be any filename that contains the display name of a ESX/ESXi separated by a newline

e.g.

[vi-admin@scofield ]$ cat hostlist
esx4-1.primp-industries.com
esx4-2.primp-industries.com
esxi4-1.primp-industries.com
esxi4-2.primp-industries.com

Specify specific Virtual Machines to query

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

where vmlist can be any filename that contains the display name of a Virtual Machines separated by a newline

e.g.

[vi-admin@scofield ]$ cat vmlist
Norman-CL1
ft-test-vm
VA-Tomcat
reflex-g2
vMA-2
build-centos
build-ubuntu
sam3testV2
Rhapsody
goldmaster
test-vm1
test-vm2
dummy

Email report

./vmwarevSphereHealthCheck.pl -server VC_SERVER --username VC_USERNAME --password VC_PASSWORD --type vcenter --email yes

Note:

Ensure that you have all the email variables configured either within the script or in the external configuration file, else the report will not be sent.

Hostd Log

To specify the number of the latest lines in the hostd logs, use --logcount \[number_of_lines\]

(e.g.)

./vmwarevSphereHealthCheck.pl -server VC_SERVER --username VC_USERNAME --password VC_PASSWORD --type vcenter --logcount 20

Cluster Performance Stats

To collect basic performance stats from all Clusters, note that the duration of the script may potentially increase. Only use if you need and by default it's disabled.

(e.g.)

./vmwarevSphereHealthCheck.pl -server VC_SERVER --username VC_USERNAME --password VC_PASSWORD --type vcenter --clusterperforamnce yes

Host Performance Stats

To collect basic performance stats from all Hosts, note that the duration of the script may potentially increase. Only use if you need and by default it's disabled.

(e.g.)

./vmwarevSphereHealthCheck.pl -server VC_SERVER --username VC_USERNAME --password VC_PASSWORD --type vcenter --hostperformance yes

VM Performance Stats

To collect basic performance stats from all VMs, note that the duration of the script may potentially double. Only use if you need and by default it's disabled.

(e.g.)

./vmwarevSphereHealthCheck.pl -server VC_SERVER --username VC_USERNAME --password VC_PASSWORD --type vcenter --vmperforamnce yes

Output printer friendly format

This will update the CSS in the html report to allow you to print the report in a friendly format

./vmwarevSphereHealthCheck.pl -server VC_SERVER --username VC_USERNAME --password VC_PASSWORD --type vcenter --printerfriendly yes

-


Custom Report Configuration

There are 54 parameters that can be configured to display various categories of the health check report. By default, everything is set to "yes" except the following 4:

CLUSTER_PERFORMANCE

HOST_PERFORMANCE

VM_PERFORMANCE

VM_DELTA

as these can potentially increase the amount of time the report takes to generate.

###################
## EMAIL OPTIONS ##
###################

EMAIL_HOST=mail.primp-industries.com
EMAIL_DOMAIN=primp-industries.com
EMAIL_TO=william@primp-industries.com,tuan@primp-industries.com,monitoring@primp-industries.com
EMAIL_FROM=vMA@primp-industries.com

###################################
## RESOURCE CONSUMPTION WARNINGS ##
###################################
# yellow < 30%
# orange < 15%
# red < 10%

YELLOW_WARN=30
ORANGE_WARN=15
RED_WARN=10

############################
##  SNAPSHOT AGE WARNINGS ##
############################
# yellow > 15 days
# orange > 30 days
# red > 60 days
SNAPSHOT_YELLOW_WARN=15
SNAPSHOT_ORANGE_WARN=30
SNAPSHOT_RED_WARN=60

#################
## SYSTEM INFO ##
#################
SYSTEM_LICENSE=yes
SYSTEM_FEATURE=yes
SYSTEM_PERMISSION=yes
SYSTEM_SESSION=yes
SYSTEM_HOST_PROFILE=yes
SYSTEM_PLUGIN=yes

#################
## DVS
#################
DVS_SUMMARY=yes
DVS_CAPABILITY=yes
DVS_CONFIG=yes

###############################
## DATASTORE CLUSTER OPTIONS ##
###############################
DATASTORE_CLUSTER_SUMMARY=yes
DATASTORE_CLUSTER_POD_CONFIG=yes
DATASTORE_CLUSTER_POD_ADV_CONFIG=yes
DATASTORE_CLUSTER_POD_STORAGE=yes

#####################
## CLUSTER OPTIONS ##
#####################

CLUSTER_SUMMARY=yes
CLUSTER_PERFORMANCE=no
CLUSTER_HA=yes
CLUSTER_DRS=yes
CLUSTER_DPM=yes
CLUSTER_AFFINITY=yes
CLUSTER_RP=yes
CLUSTER_VAPP=yes

##################
## HOST OPTIONS ##
##################

HOST_HARDWARE_CONFIGURATION=yes
HOST_MGMT=yes
HOST_STATE=yes
HOST_HEALTH=yes
HOST_PERFORMANCE=no
HOST_NIC=yes
HOST_HBA=yes
HOST_ISCSI=yes
HOST_CAPABILITY=yes
HOST_CONFIGURATION=yes
HOST_ADVOPT=yes
HOST_AGENT=yes
HOST_NUMA=yes
HOST_CDP=yes
HOST_LUN=yes
HOST_DATASTORE=yes
HOST_CACHE=yes
HOST_MULTIPATH=yes
HOST_PORTGROUP=yes
HOST_DVS=yes
HOST_LOG=yes
HOST_TASK=yes

################
## VM OPTIONS ##
################

VM_STATE=yes
VM_CONFIG=yes
VM_STATS=yes
VM_RESOURCE_ALLOCATION=yes
VM_PERFORMANCE=no
VM_FT=yes
VM_EZT=yes
VM_THIN=yes
VM_DEVICE=yes
VM_STORAGE=yes
VM_NETWORK=yes
VM_SNAPSHOT=yes
VM_DELTA=no
VM_CDROM=yes
VM_FLOPPY=yes
VM_RDM=yes
VM_NPIV=yes
VM_TOOL=yes

#################
## VMware Apps ##
#################
VMW_APP=yes

##################
## VPX SETTINGS ##
##################
VPX_SETTING=yes

-


Setup & Run Health Check Script on Windows

Here are instructions on configuring vSphere Health Check Script to run on Windows with PowerCLI submitted by user whinshaw

http://www.myvmland.com/?p=124

Note: For comments/inquires about this intergration, please refer to the author of the post.


Change Log

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

02-17-2013 - v5.1.0

Enhancements:

  • Updated to support vSphere 5.1 and minor fixes

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

12-29-2011 - v5.0.2

Enhancements:

  • Permission validation was recently added but had several unforeseen   issues when logging in with domain accounts. For now, this has been   removed. The documentation has been updated with the minimum permission   set required to the run the script.
  • Added --debug flag for troubleshooting

Fixes:

  • Minor fixes in validation of output

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

06-19-2011 - v5.0.0

Enhancements:

  • vCenter Server Instance UUID
  • vCenter hostname
  • Storage DRS Configuration (Maintenance Mode, Stats Aggregation, Stats Collection for Datastores)
  • FDM/HA Heartbeat Policy + Datastore
  • FDM/HA State
  • Host Agent Settings
  • Host New iSCSI Configuration/Information
  • Host FCoE HBAs
  • Host Source Packages for ESXi Services
  • Host ESXi Capabilities
  • Host SMC Hardware Information regarding OSX Support
  • Host Updated Firewall Rules (direction, port type, port, protocol and allowedIPs)
  • Host Cache SSD Datastore details
  • Host DVS IPFIX Details + NIOC
  • Virtual Machine Virtual Hardware Version
  • Virtual Machine Firmware, Initial overhead memory + swap
  • Virtual Machine State
  • Virtual Machine Snapshot consolidation + HA protection
  • Virtual Machine Detailed Disk Type (zeroedthick,eagerzeroedthick and thin)
  • Updated color mappings for multipath states
  • Support for standalone ESX(i) hosts without vCenter Clusters
  • New healthCheck.conf variables:  DVS_SUMMARY, DVS_CAPABILITY, DVS_CONFIG, DATASTORE_CLUSTER_SUMMARY, DATASTORE_CLUSTER_POD_CONFIG, DATASTORE_CLUSTER_POD_ADV_CONFIG, DATASTORE_CLUSTER_POD_STORAGE, HOST_ISCSI, HOST_AGENT, HOST_CACHE, VM_STATE, VM_EZT
  • Updated color scheme for HTML report

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

04-18-2011 - v4.1.9

Enhancements:

  • Included vCenter Server in title of report

  • Included time stamp in title of report

Fixes:

  • VM ratio count issue resolved

  • Can't locate object method "group" via package "ClusterConfigInfoEx"

  • Compressed memory metric display issue resolved

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

01-23-11 - v4.1.6

Fixes:

  • Resolved CSS display issues with Chrome & Safari, report now should be compatible with Firefox, Internet Explorer, Chrome and Safari

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

01-03-11 - v4.1.5

Fixes:

  • Minor fix on cluster info that causes the following error "Undefined subroutine &ClusterVmHostRuleInfo::vm called"

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

10-16-2010 - v4.1.4

Enhancements:

  • VM count per cluster displayed in Cluster Summary tab

  • VM-to-Host ratio displayed in Cluster Summary tab

Fixes:

  • Minor fix on cluster info

  • Added VMware/3rd Party Application Section (some reason the code was missing during one of the updates)

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

10-10-2010 - v4.1.3

Enhancements:

  • VM count per datastore

Fixes:

  • Fixed logic for checking SIOC for non-VMFS volumes

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

07-22-2010 - v4.1.2

Fixes:

  • Updated script to support running on both vMA 4.0 and vMA 4.1. If you're managing ESX(i) or vCenter 4.1 hosts, you must use vMA 4.1

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

07-13-2010 - v4.1.0

Enhancements:

  • DRS Affinity Rules

    • In Compliance

    • Mandatory

    • User Created

  • DRS GROUP Rules

    • Host group

    • VM group

  • COS VMDK PATH

  • HA Configuration Issues

  • Host capabilities

    • Storage IORM

    • VM Directpath G2

    • vStorage Hardware Acceleration

  • Host Datastore

    • SIOC State

    • Congestion Threshold

  • Host Configurations

  • Feature specific version information

  • Host State

    • Uptime

    • Standby mode

  • VM State

    • Uptime

  • Host Authentication Services

    • Local

    • Active Directory

  • VM Config

  • App Heartbeat

  • VM Stats

    • Compressed memory

  • Host LUN

    • vStorage/SIOC capable

  • Host Advanced Configuratoins

    • VMFS3.HardwareAcceleratedLocking

    • DataMover.Hardwar eAcceleratedMove

    • DataMover.HardwareAcceleratedInit

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

06-05-2010 - v4.0.8

Enhancements:

  • Added two new configuration options VMW_APP and VPX_SETTING

  • Added vCenter VPX Configuraton tab (only available when connecting to vCenter)

  • Added VMware Application tab (only available when connecting to vCenter)

  • Updated HA cluster failover policy display

Fixes:

  • Resolved minor html mis-match tags

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

04-28-2010 - v4.0.7

Fixes:

  • Resolved issue with HA configuration policy failover

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

04-02-2010 - v4.0.6

Enhancements:

  • Added VMFS blocksize + version in Datastore output

  • Added param to output printer friendly format

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

04-01-2010 - v4.0.5

Enhancements:

  • Added VM Devices section (VM_DEVICE)

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

03-27-2010 - v4.0.4

Enhancements:

  • Changed "Cluster Statistics" to "Cluster Summary" (CLUSTER_SUMMARY)

  • Added Table of Contents for Cluster Tab

  • Changed Cluster Performance "mem.usage.average" to "mem.consumed.average"

  • Added CLUSTER_SUMMARY as configurable property

  • Added DRS Current and Target balance information

  • Added VM list to Affinity Rules

  • Added CPU/MEMORY Shares info in Resource Pool under Cluster + CPU/MEM Units per VM

  • Added Lockdown Mode informaiton (applies to ESXi only)

  • Added 8 addtional Advanced Host Configuration including (NFS + TechSupport Mode configurations)

    • NFS.MaxVolumes

    • SendBufferSize

    • ReceiveBufferSize

    • Net.TcpipHeapSize

    • NFS.HeartbeatFrequency

    • NFS.HeartbeatTimeout

    • NFS.HeartbeatMaxFailures

    • VMkernel.Boot.techSupportMode

  • Added Host Capabilities section (HOST_CAPABLITIY)

  • Added VM Resource Allocation (shares/limits/etc) section (VM_RESOURCE_ALLOCATION)

  • Added vCenter Plugin information (SYSTEM_PLUGIN)

Fixes:

  • Resolved a few bad HTML tags

Known Issues:

Big thanks goes out to Raphaël SCHITZ for providing some feature suggestions + extensive testing of the script!

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

03-21-2010 - v4.0.1

Enhancements:

  • Email report now supports multiple email recipients

Fixes:

  • Thanks to user arjaysam1 for noticing there was some bad math going on with the hardware numeric sensor values, this has now been fixed so properly display the values (e.g. 48 C instead of 4800)

  • Thanks to user Altix for suggesting adding addtional padding to the CSS style for the scrollbar at the bottom for better visiblity

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

03-18-2010 - v4.0.0

Enhancements:

Cluster

  • HA Advanced Runtime information

  • HA Configuration (primary/secondary and node states)

  • HA Advanced Configurations

  • DRS Advanced Configurations

Host

  • IP/HOSTNAME of vCenter Management IP

  • Newly improved Hardware and System Health Status information

  • Advanced Configurations

  • NUMA information

Virtual Machine

  • UUID

  • Bootime

  • Resource statistics

  • Fault Tolerance information

  • Thin provisioned information

  • NPIV information

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

02-28-2010 - v1.5.3

Enhancements:

-Added additional command line options to specify whether or not to includ Cluster,Host or VM performance stats, the default is to not display this information as it can increase the runtime of the script depending on the size of your environment

Fixes:

-Updated email functionality to have the report as an attachment

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

02-13-2010 - v1.5.0

Enhancements:

-Added email report capablity

Fixes:

-Finally resolved performance data issue for VMs (Thanks to Raphael Schitz for reporting the initial problem and verifying the fix)

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

01-21-2010 - v1.4.1

Fixes:

-Performance data was not properly displaying and now have been fixed for all 3 entity levels (cluster,host and vm)

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

01-17-2010 - v1.4

Enhancements:

-Host configurations now includes vCenter managed IP Address

-Summary of User and Group permissions for vCenter server

-Host summary now includes Host & SCSI LUN Model attribute

-Host state summary now includes boottime

-Host LUNs now include additional information including Datastore,VolumeUUID,DiskName and DeviceName

-VM network summary now includes portgroup information from both standard vSwitches + distributed vSwitches

-Performance statistics (cpu/mem AVG+%) for both vCenter clusters and host

-Performance Statistics for VM (cpu/mem avg + %, ready & ballon) is optional.

Note:

Enabling VM performance stats gathering can potentially incrase the script execution up to 2x. From the sample execution in our envrironment, the report went from 46secs to 1.3min. By default this feature is disabled and you'll need to specify param --vmperformance 1 to enable at runtime.

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

11-23-2009 - v1.3

Fixes:

-Fixed snmp output, small typo in the script

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

05-24-2009 - v1.2

Fixes:

-Minor fix in nDVS that was causing script to halt

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

05-04-2009 - v1.1

Enhancements:

-Display additional VM Storage details (committed,uncommitted and unshared)

Attachments
Comments

Thanks for identifying how to print out the report. As far as the SCSI controller if it could print out with the VM OS selection so you could see the SCSI controller along with the OS it would be great. That way you could easily identify which VM has the wrong SCSI controller very easily. Even if it has mutiple disk all SCSI controllers should be the same "w2k buslogic, w3k3 lsilogic". Most likely the VM-converter would have selected the same SCSI controller for multiple SCSI controllers. Probably won't see multiple SCSI controllers unless your dealing with MSCS VM's?

Thanks again for all your hard work on this. Great tool to have in your health check tool box!

Let me think about the request for a little big, the problem is where this information is actually available. To get this, you need to basically loop through all "devices" that a VM has, whether that's a SCSI controller, USB controller, disks, cpu, nics, etc. The question becomes, is this the only "additional" piece of information that is useful to end users or are there other things about the devices that might be useful. I only say this, because if there are "other" things that are useful, I may want to introduce a new section maybe "VM Devices" and provide a separate section else the "VM Configuration" can get pretty full and make readability slightly hard.

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

That's actually a great idea. You don't want to "muddy up" the report so another section as you say may be best. When ever I do a healthcheck and get to the VM section you can always tell VM's the customer has P2V'ed because they have orphaned devices such as serial ports, usb, printer ports, etc. Thanks for the consideration. It will certainly speed up the healthcheck process along with the VMware Health Analyzer.

It would be good if the Snapshot section of the report also list "Creator of the snapshot" ie, who created the snapshot.

Happy to hear comments pls

thnks

Unfortunately the "Creator" of the snapshot is not a property that is included within the snapshot information within the APIs. You would need to basically correlate the snapshot and hopefully locate the name of the snapshot within the past events and figure out that way. This is on the assumption that your event logs for vCenter go back that far to be able to extract this information.

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

Awesome script as usual.

But what exactly does the VM_DELTA parameter do? Being lazy, I haven't enabled and checked it myself yet.

Airline-based replication? (that's merely a guess)

Smiley Happy

I get a fault and the script aborts. Its actually a datastore that is not accessible. But I was wondering if we could skip that and generate the usual report.

SOAP Fault:

-


Fault string: Datastore '[DRP_ESX]' is not accessible.

Fault detail: InaccessibleDatastore

End Disconnect

It basically does a search within all the datastores looking for snapshot delta files older than certain amount of days, which can aide in looking for stale or orphaned snapshot files. If you're that lazy to enable the feature, you can take a look at the sample report which shows you what the output would look like.

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

I currently already check to see if a given datastore is accessible via the API, not sure exactly what type of state your datastore is in. I would recommend that you resolve the problem on why your datastore is not accessible instead of trying to go around the problem.

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

William,

This is a very nice report and I very much appreciate the effort you have put into it.

I ran the report initially on my vCenter server when it only had one cluster and the report worked fine. i have since moved the rest of my production environment to the vCenter server which includes 3 other HA clusters. After the addition of these other ESX servers and HA clusters I now get the same error noted above:

"Use of uninitialized value in concatenation (.) or string at ./vmwarevSphereHealthCheck.pl line 3214.

Can't locate object method "slotInfo" via package "ClusterDasAdvancedRuntimeInfo" at ./vmwarevSphereHealthCheck.pl line 3231."

We have not made any changes to the vCenter server with the exception of the added hosts.

I am running the healthcheck script from the latest vMA, using vifp and my server set to the vCenter server, with the following syntax:

./vmwarevSphereHealthCheck.pl --server vCenterServerName --type datacenter --datacenter "DC Name"

I have also tried it this way:

./vmwarevSphereHealthCheck.pl --server cantorvc4.goldbar.barrick.com --type vcenter

is there a way to manually set the "slotInfo" value?

Thank you again for your work on this it is a great resource,

KJ

afaik, this property should be available/valid if your hosts are in an HA cluster. I don't have a lot of hosts to test the various combination, but what I was able to do was create a new Datacenter and a new Cluster with only HA enabled and put in a single ESXi 4.0 host with no VMs and I'm able to see the property still define w/o any issues.

Regarding the slotsinfo, this is something that's set by the cluster based on the largest VM configurations and then the slots information is generated from this, I don't believe this is something can change.

I guess I'll need to ask a few questions about your environment:

1. Are all hosts running vSphere?

2. There's 2 clusters total, correct?

3. Could you run the report on each cluster and see if you get back the same results as before?

4. Could you please provide either screenshots/text of the exact HA configurations for the cluster that fails and the one that works.

Thanks

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

Hi Guys,

When I use --printerfirendly yes it says unknown option printerfriendly, any help will be good.

Regards

Ash

That's expected since you spelled the option incorrectly, it's --printerfriendly Smiley Happy

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

Sorry I did used --printerfriendly with same error

$ ./vmwarevSphereHealthCheck.pl --server server --username user password passwordtype vcenter --printerfriendly yes

even

$ ./vmwarevSphereHealthCheck.pl --server server --username user --password password --type datacenter --datacenter VDC_HDC_01 --printerfriendly yes

both comes with error unknown option

I just tried and it works fine for me:

[vi-admin@scofield vmwarevSphereHealthCheck]$ ./vmwarevSphereHealthCheck.pl --type vcenter --printerfriendly yes
Generating VMware vSphere Health Report 4.0.6 "vmware_health_report.html" ...

This can take a few minutes depending on environment size.
Get a cup of coffee/tea and check out http://www.engineering.ucsb.edu/~duonglt/vmware/


Start Time: 04-20-2010 23:39:14
End   Time: 04-20-2010 23:39:55
Duration  : 41 Seconds

Can you please verify that you're running the latest version of the script which should be 4.0.6?

[vi-admin@scofield vmwarevSphereHealthCheck]$ ./vmwarevSphereHealthCheck.pl --version
VI Perl Toolkit version: 4.0
Script 'vmwarevSphereHealthCheck.pl' version: 4.0.6

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

Hi William

As of version 4.0.1 when you introduced multiple email recipients I got the email sent to destination address

1@mycompany.com (I configured only one destination address did not try multiple)

I modified your script

from this:

....

$smtp->to(@EMAIL_TO);

...

$smtp->datasend('To: '.@EMAIL_TO."\n");

....

to this:

...

$smtp->to(join(',', @EMAIL_TO));

...

$smtp->datasend('To: '.(join(',', @EMAIL_TO))."\n");

and now it works fine

Hope this helps

And please keep going this script is great!!!

E.A.

______________________________________________

you do not really understand something

unless you can explain it to your grandmother

(Albert Einstein)

Happy birthday, VMware vSphere Health Check Report!

ah didn't even notice Smiley Happy Happy Birthday indeed!

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

Just came across this, added to my arsenal Smiley Happy

Excellent script, and took <10 minutes from download to reviewing a fully detailed report on my production clusters... Awesome-

Thanks for including the section on VM devices with the OS. Looks great.

When I run the script on vMA I am getting:

Use of uninitialized value in concatenation (.) or

string at ./vmwarevSphereHealthCheck.pl line 890.

It produces the html but I don't know the effect of

this error.

Thanks for the hard work.

Can you tell me at what section did the output stop at?

Line 890 refers to VMs with FT enabled, can you try disabling that specific output to see if the problem still persists?

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

i rem line 890 and there was no error.

I've got the same slotinfo-errror from 'ClusterDasAdvancedRuntimeInfo'.

Calling ClusterDasAdvancedRuntimeInfo outside the report script gave only the cluster name.

I built a new cluster with two of my hosts and ClusterDasAdvancedRuntimeInfo worked fine.

So I decided to move all my other hosts to the new cluster.

Afterwards I had no problems with ClusterDasAdvancedRuntimeInfo any more.

Thanks for this very helpful script!

(13 hosts / 1 cluster / VMware HA Admission Control disabled)

I'm trying to run this, I can't get it to run on any of my 3 clusters. Actually getting two different errors:

Use of uninitialized value in concatenation (.) or string at ./vmwarevSphereHealthCheck.pl line 3220.

Can't locate object method "slotInfo" via package "ClusterDasAdvancedRuntimeInfo" at ./vmwarevSphereHealthCheck.pl line 3237.

My clusters are configured with DRS & HA. HA options are:

-Admission Control enabled with a 40% reserve policy

-Host Monitoring is on

-VM Monitoring is off

FYI: I changed my configuration to tolerate 1 host instead of the 40% reserve and it started working.

-


Shane Wendel

VCP: vSphere 4

VCP: VI3

http://fatalsync.wordpress.com

I think I know why it's failing and as you've said, it depends on how you've configured your failover. I'll hopefully have a quick fix later tonight that resolves this problem in 4.0.7 release.

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

Give the new version a try and you should be able to get it to run w/o any issues with the previous configuration you had.

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

The first error is gone, but the second (regarding slotInfo) remains at the same line when the cluster is configured for a percentage reserve.

If I disable Cluster_HA, it works, but I'm guessing you already knew that.

-


Shane Wendel

VCP: vSphere 4

VCP: VI3

http://fatalsync.wordpress.com

Can you please run this piece of debugging script to see exactly what each of your clusters return - http://communities.vmware.com/docs/DOC-12466

Use pastebin or something to copy the output and just provide me the link of the output.

Thanks

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

Could you replace line 3237 with the following:

if($haAdvInfo->isa('ClusterDasFailoverLevelAdvancedRuntimeInfo')) {

This should resolve it based on the debugging output provided from your dump.

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

Fixed 3237, now on 3242

Can't locate object method "totalSlots" via package "ClusterDasAdvancedRuntimeInfo" at ./vmwarevSphereHealthCheck.pl line 3242.

-


Shane Wendel

VCP: vSphere 4

VCP: VI3

http://fatalsync.wordpress.com

Okay, cool. I know exactly what's wrong.

If you're comfortable, you can change that big block of code to this: http://pastebin.com/LUubAQLx

If not, I should be able to push an update tonight and let you try again.

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

Yep, that did it for fully executing. Thanks.

It just shows slotsizes as N/A now.

-


Shane Wendel

VCP: vSphere 4

VCP: VI3

http://fatalsync.wordpress.com

Excellent. If you can provide a screenshot of various cluster configurations, I can try to replicate in my lab and provide a better solution in terms of what to look for. I'm guessing it has to do with your failover configuration, but I'm not exactly sure which. Thanks

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

Excellent script William! can you advise on an error im getting:

cant locate object method "vmMonitoring" via package "ClusterDasConfigInfo" at path_to_script line 2691.

Thanks

Bob

That line # does not match what you're referring to in the latest version of the script. Please make sure you're running the latest version of the script.

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

I have created a step by step documentation on how to install this on windows if anyone is interested. Many thanks to William.

Step by step guide to automate and email.

http://www.myvmland.com/?p=124

Thanks,

Wes

Thanks for the post, I'll go ahead and update the documentation when I get a chance to share with the community. I would ask that you don't hard link the download, but reference this documentation here for the latest version.

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

The post has be updated with your request.

Thanks for everything,

Wes

Hello everyone,

We recently hit a snag with our development environment and we need your help - http://engineering.ucsb.edu/~duonglt/vmware/help.html

Any contributions are appreciated!

Thanks!

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

Hi,

I want to use the script on a vma against a Vsphere cluster with esx4 hosts. When I run the script I get the error:

Can't use an undefined value as an ARRAY reference at /home/vi-admin/vmwarevSphereHealthCheck/vmwarevSphereHealthCheck.pl line 433

I'm not into Perl so now what?

Can you please help me with this one?

Update: Actually I know the problem, this was actually reported awhile back by a user and it has to do with the lack of permissions with the account you're using to run the report:

per @Altix

Your problem might be a small permission issue. Using the "ReadOnly" Role or another one with the wrong Perms let you get an error like the one from above.

The needed perms for fetching all data which are currently possilble with version 4.0 of the script are the following:

Datastore->Browse Datastore

Global->Diagnostics

Global->Licenses

Sessions->View and stop sessions

You're most likely requiring Sessions->View and stop sessions" since the error is with the Session List

Give that a try and see if it works

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

William Lam

VMware vExpert 2009

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

Twitter: @lamw

vGhetto Script Repository

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

Hi William,

first thank you for all the scripts, it helped me a lot to get into the api Smiley Happy

then i used the last version available and get the error :

Can't locate object method "slotInfo" via package "ClusterDasAdvancedRuntimeInfo" at /usr/local/vsphere/vmwarevSphereHealthCheck.pl line 3241.

I have only this error when configuring my cluster H/A to use a "failover host".

Using "host failover cluster can tolerates", it worked.

vinny

Vinny,

Yep, I'm aware of this and it has been fully resolved in the next release. We recently had a snag in our development environment - http://engineering.ucsb.edu/~duonglt/vmware/help.html

I have the code updated but need to do few final verification before releasing, expect to see something this week, hopefully.

Thanks

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

William Lam

VMware vExpert 2009

VMware scripts and resources at:

Twitter: @lamw

vGhetto Script Repository

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

Check out the updated 4.0.8 release of the script, this should resolve the problem you're running into.

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

William Lam

VMware vExpert 2009

VMware scripts and resources at:

Twitter: @lamw

vGhetto Script Repository

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

William,

Great upgrade, all's solved !

vinny

Hi All,

Im looking to see if someone can help out. When the script is run I need it to return a 0 due to the software we use to schedule and run it.

Thank you,

You should be able just check the exit status of the script - http://steve-parker.org/sh/exitcodes.shtml

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

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

vGhetto Script Repository

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

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

Version history
Revision #:
1 of 1
Last update:
‎04-21-2009 11:24 PM
Updated by: