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

Hi,

Looks like when I initially wrote this script ...wayyyyy back this was a section that I did not pay too close attention to regarding the output values.

As described by: http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.host.NumericSensorInf...

It looks like the actual reading is multiplied by 10 and raised to unitModifier returned by the specific sensor.

So basically for Temp (since I looked it up on our setup), it should have been:

8400*10^-2 ~= 84C

which looks much closer to your 80C.

Even though this is described as the formula in the vSphere API docs, I noticed it's not exact as I see it in the Hardware Status, I'm curious if the formula is wrong or if something else is off. Though this should get you much closer to the actual reading.

I'll go ahead and accept this as a fix and I'll put out an update once I get a chance along with few other fixes/features.

Regarding your 2nd question, I'm thinking this might be related to the recently added performance stats which actually should be fixed in an upcoming release. I'll defer that to the next release and hopefully that issue goes away.

Thanks for your comments

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

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 Comuunity

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

Thanks for your quick response, William. I appreciate your help and the fixes you are going to make. I'm hoping to have the script running with VMA at all my customer sites as it meets a need head on. Thanks again.

Robert

William is the bomb!

(W - I haven't given up trying to inject customizable CSS templates into this script, but like you there are eleventy-billion other priorities)

If anyone is curious, I'm hoping to automate formatting to look like this:

(with user-controlled colors)

http://ocnav.com/test.html

80% there - nested tables are crushing my will to live......

Very cool, looking forward to the final product with the custom colors.

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

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 Comuunity

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

Would you pease help. I am getting the following error when running this to a vcenter and I get only part of report:

Can't call method "type" on an undefined value at /usr/lib/perl5/5.8.8/VMware/VICommon.pm line 1244.

VCP

Unfortunately this is a very generic error message and does not really pin-point where within the script the issue occurred in. If you have a partial report generated, can you let me know up to what part was completed populated by the script? I'm assuming you're executing this against a vSphere environment with ESX(i) 4.0 hosts?

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

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".

Well I could send it to you. The thins is that I have few datacenters and it starts to run repport and takes just as you mentioned just part of one (or few esx servers) of our datacenters....

VCP

Do you always run into the error? (e.g. what if you ran it against individual ESX host? cluster? datacenter?)

If you can run it on a smaller entity such as a host or individual datacenter, then it might be easier to troubleshoot and you can send me a copy of the report.

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".

The thing is that I have two vCenters environments and I am running vMA on one of ESX hosts belonging to one vCenter. Health check is running fine on vCenter object here. When I am running healthcheck on the other vCenter object the script is running and i generated but it does not take all of the ESX hosts and/or objects but is intreruppted instead with above mentioned error message. Does it mean that I need to install one more vMA for the other vCenter (and ESX hosts/VMs in it). If the answer is Yes how come that some of ESX apperas anyway in this partial repport?

VCP

You can have 1 vMA run across any vCenter, host, etc. you don't need more than one. The reason you're only seeing a subset of the report generate is there is 'something' that is either not handled correctly in the script regarding a specific configuration setup on one of the host which is causing the script to halt. Since you've been able to isolate it to the one of the 2 vCenters, take a look at at the report that's generated and see which ESX(i) host it was still processing, once you get that, then run a report specifically on that host and see if you get the issue OR if it only occurs when running against vCenter and it gets to that host. Once you isolate it there, then you can send me the report and I can take a look at what section the code breaks down and I may need to ask few additional questions depending on where the reports stops. Hopefully that make sense

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

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".

All of sudden everything works fine Smiley Happy This is great. The only thing that is different is that I upgraded my vCenter to Update 1.

Thanks a bunch for help

VCP

Ah cool to hear, that technically shouldn't have made a difference. This script is specific for vSphere in general, whether that's 4.0 or 4.0u1.

Either way, glad to hear you got it working 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".

Would you please explain something. When checking the repport and part with datastore for esx i see values for free datastore space and uncommited space. Uncommited space value is higher than free space. I am guessing thing provisioning here but anyway what is the right trigger and what uncommited vs free gives me than?

VCP

Hi William

first things first: Thank you very much for this script it rocks!

I noticed you mentioned a new feature (--clusterperforamnce there is a typo in the example ) introduced in the version 1.5.3 but it seems I can download from this link only the version 1.5.2.

Do you mind update the copy attached?

Thanks in advance.

Hi,

I've just re-uploaded the latest version, let me know if you're seeing the new version of the script. Also the typo should be fixed.

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".

Yes. I have the new version now and works like a charm.

Thank you!

E.A.

Does anybody found a way to send the mail to more than one recipients?

I second this question!

I have tried seperating two email addresses by comma and semi-colon and it doesn't like either, bombs the whole email function.

Example (part of healthCheck.conf):

EMAIL_TO=cderemer@phoebe.org; aheckman@phoebe.org

or

EMAIL_TO=cderemer@phoebe.org, aheckman@phoebe.org

but just

EMAIL_TO=cderemer@phoebe.org

Work Great!

Simply brilliant William. Thanks again for doing such a great job and making my life so much easier!!

Why not just create a group email account and use that?

Dave Convery, VCDX

VMware vExpert 2009

http://www.dailyhypervisor.com

http://twitter.com/dconvery

Careful. We don't want to learn from this.

Bill Watterson, "Calvin and Hobbes"

Thanks Troy! Glad it's helpful, let me know if there are any other features that might be useful to add.

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

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".

@benma @aheckman

I'll take a look to see if this is possible with what is available with the default installation of the vSphere SDK for Perl, this functionality is definitely available but may not be with the default Perl modules that's included with the vSphere SDK for Perl or on vMA.

I prefer not to require additional packages for end-users to have to install and the current limitation is with the Perl module that's being used for email, it most likely only supports 1 recipient.

As Dave mentioned, you could also just use a DL

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".

@William,

You just need to use an array for @EMAIL_TO.

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

  1. EMAIL CONF

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

my $EMAIL_HOST = "mail.opus.corp.root";

my $EMAIL_DOMAIN = "opuscorp.com";

my @EMAIL_TO = ('user@domain','user2@domain'); # use an arrar instead of a scalar

my $EMAIL_FROM = 'VCenter@opuscorp.com'

And tweak the sendmail function:

sub sendMail {

my $smtp = Net::SMTP->new($EMAIL_HOST ,Hello => $EMAIL_DOMAIN,Timeout => 30,);

unless($smtp) {

die "Error: Unable to setup connection with email server: \"" . $EMAIL_HOST . "\"!\n";

}

open(DATA, $report_name) || die("Could not open the file");

my @report = , SkipBad => 1 });

$smtp->to(@goodrecips);

$smtp->data();

$smtp->datasend('From: '.$EMAIL_FROM."\n");

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

Ken

Nice! Yea I never dug too deep and would be surprised if this wasn't supported with the default Net::SNMP package.

I'll give this a test and then update the script when I get a chance, will be busy this weekend so hopefully get it into the script by next week.

Thanks 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".

nice script.

I'm trying to run it, from the vMA, and I get

Can't use an undefined value as an ARRAY reference at ./vmwarevSphereHealthCheck.pl line 405.

I'm not sure if this might be due to the username password format I'm using

e.g. username: "mydomain\myuser"

password: This@pwd

I wondered if I needed to somehow escape the '\' in the domain name, or the '@' in the password?

It should not matter, if you entered it in plain text, you just need to double quote it. I believe what you're running into is an issue when the list of sessions are returned.

Could you try changing SYSTEM_SESSION="yes" to "no" either in the script or if you're using the healthCheck.conf, just update it there and re-run to see if you can get pass that.

Generally if it was a connection issue such as bad username/password, it would have halted right away and not go further into the script and in your case, it got through which means you were able to login successfully.

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

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".

Altix,

Thanks for the comments and suggestions!

1) Regarding the NFS issue, I'll go ahead and also check to ensure the datastore is accessible prior to extracting data from it, this should eliminate this problem.

2) I'll go ahead and update the style to include this additional padding, as you can see, I'm not web design guy what so ever Smiley Wink This definitely beats the old "gray" scheme

3) Let me do some testing, but I believe this value is actually correct and it goes back to how this is actually being calculated by VMware, unfortunately this "memory usage" value is not the same as "consumed" which is what you're most likely looking at.

4) I'll double check this, I thought I had fixed this awhile back but perhaps missed it during the re-write.

I'll try to get these updated in the next release which should also include multiple email recipients support.

Thanks 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".

Altix,

Just release v4.0.1 which includes some of your suggestions.

Regarding the NFS issue, I actually do check to see if it's accessible, perhaps even though it's "considered" mounted by ESX(i) host, it could still have some issues. If you can provide further details or how to potentially replicate the issue, I could perhaps add additional checks. This may be corner case and might be something that needs to be resolved on the end user before running the script.

Regarding the Memory usage for the cluster stats, the result is in fact correct. If you take a look at the API reference document for how mem.usage.average is calculated: http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/memory_counters.html at the cluster level:

Cluster: memory usage = memory consumed + memory overhead ÷ effectivemem

If you do the math, you should come up with the same value which is what the script is reporting on. This is the expected value and actually I had a case opened up with VMware a few weeks back and this is correct/expected value by engineering. Though what we all like to see is actually the "consumed" amount as a percentage but that's not available today, you have to do some math to get an actual percentage.

The hardware sensor bug was actually reported earlier in this post: http://communities.vmware.com/docs/DOC-9842#comments-14445 but I must have missed it while doing the re-write. This should not be reporting the correct values.

Give the new script a try and let me know if you run into any other issues.

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 William,

Very basic question as I have zero *nix knowledge..

Downloaded and installed;

vMA-ovf-4.0.0-161993

vmwarevSphereHealthCheck.tar.gz

Ran the following

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

Which worked fine, created a vmware_health_report.html file

How can I get the webserver to display the reports?

Is the website installed by default?

Thanks for the script and vm by the way, the sample pages I have seen to far look very promising.

Adrian

Adrian,

vMA does not have a webserver by default, so you would not be able to view the report directly on the system. You can however install apache if you would like, but it's really meant to be used to manage and configure your ESX(i) hosts and should be kept as slim as possible.

What you'll want to do is transfer the report off of the vMA host using something like scp (do a search for WinSCP) if you're on a Windows platform. This will allow you to copy out files and then view it on your own system or a server that does have a webserver.

Note, you can also send the report as an email if you have an email server which then allows you to create a simple schedule to automate the report if you like.

If you want to even further automate this to pull the report into say an intranet webserver, you could use something like VMware VIX and vmrun to basically extract the report and upload it to your webserver. This is something I've actually done for some internal reporting and basically is automated everyday to upload to the site.

Hopefully this gives you a few ideas on displaying the report.

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

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,

The scripts works good for me: using RCLI in Windows, --passtruauth works. VC4U1. Havent had chanhce to look thru all the informs in report, but they ARE so impressive.

Question: How can I get to specify where the report go to? ie, be default it is writtent to .."C:\Program Files\VMware\VMware vSphere CLI\bin\" or where I run the script. I want to be able to direct to somewhere else.

thanks

VanT

Ver 4.0.1

I am using the Firefox Windows version. --JavaScript or CSS collapses when type host is used. It not repaired?

Hello,

Thanks for the comments.

Yes you can specify where the report is generated including the name of the report. Please take a look at the documentation from above and specifically at --report. Also note, you don't need to have the script stored under "C:\Program Files\VMware\VMware vSphere CLI\bin\....". By default, at least from what I've seen the vCLI/RCLI will set the correct path to the Perl interpreter, so you can even have the script run on your desktop and it'll output in the current working directory by default. Again, you can specify where it'll go and the name of the report.

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

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".

Can you provide an example of what is "collapsing", either attach your report or send me the link via PM.

I've had one report of some CSS going crazy which I'm still investigating, running it in our own environment I've not seen the issue including up to multiple 32 node clusters. I'll see if I can resolve the current reported issue and provide an updated release which may resolve the problems you're seeing.

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".

Upload: http://y17e.com/tmp/vmware_health_report.html

The file that deleted individual information was improved. It is glad when confirming it.

THanks William,

the --Report works. Did not know I could use it to specify not only the name of the report but also the path.

chrs,

VanT

Could you try disabling the following in the report:

HOST_NIC=no

HOST_HBA=no

HOST_CONFIGURATION=no

HOST_LOG=no

and seeing if the report still produces the odd layout?

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

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".

It doesn't change though it invalidates. When it is a Japanese environment, is it useless?

Hi,

I'm having a little difficulty understanding your response. I don't believe it has anything to do with the language of the environment, it's most likely something that was missed in the html. Again, I'm currently working on fixing a few errors that I see, perhaps it'll resolve your problem.

I'll update when I get the new release out.

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".

Again William, Thank you.

You are saving me a lot of work, which I always appreciate!!

Okay, I've been able to re-produce what you're seeing when connecting directly to a host, it looks like there is

that is miss-place which breaks the layout.

This will be resolved in the next release.

Thank you for bringing this to my attention.

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

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. lamw

It releases, and we will wait.

I have an n00b perl question. Our vCentre and host passwords all contain a ! , which is a special character in perl , how I can I add this password to the --password parameter in my batch file

\vmwarevSphereHealthCheck.pl --server --username xxxxx --password xxxx!xxxx --type vcenter --conf healthcheck.conf

nope have tried that and single quotes ' ' , and \ and a combination of then all... still no joy

I can run the line from the command promt ok

C:\scripts\HealthCheck\vmwarevSphereHealthCheck.4.0.1\vmwarevSphereHealthCheck\vmwarevSphereHealthCheck.pl --server --username xxx --password "xxxxxx!xxxx" --type vcenter --conf healthcheck.conf

but when I wrap it up in a batch file , it fails with bad password ...weird

Hi William

I have problems to complete the report. The script show the following error:

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/

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

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

End Disconnect

Could you help me to run successfully the script?

Thanks and regards,

afaik, slotInfo should always have a value. In either case, I've put a fix to check and this will be included in the next 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".

This is a great report. I use it all the time when performing health checks. I feel silly asking this but with the new design how to print all of the data since the layout is different?

I'm not sure what you mean? If you're referring to setting up custom report based on certain properties, please take a look at the documentation. There is no a configuration file you can pass into the script upon execution and depending on what you set to "yes", it'll display what you've selected.

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

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 previous healthcheck script produced a html report which when printed the entire html printed out. With the new design with tabs and the data being inside a frame not all pages will print, only current data in the current frame. Am I missing something really simple?

Suggestion: On healthcheck I always check the VM SCSI controllers. The VM-Converter most times will convert a w2k3 physical box and for some reason pick buslogic as the SCSI controller. We know best pratice is w2k3 servers should have lsilogic as the controller. Anyway when customers perform the P2V themselves they miss this. If the VM report section could provide the SCSI controller and OS that would be awesome.

That's a fair point, I know for larger environments, the report was slightly hard to read, at least using a computer, hence the new layout. If you want to print the entire report out, you'll need to tweak the CSS:

Search for this at the top:

div.tabcontents {
	height: 550px;
	background: #fff;
	overflow: hidden;
	border-top: 1px solid #011;
	padding: 20px;
	padding-bottom:30px;
}

and comment out "height: 550px;" which will have the report display 100% of the page.

Regarding your request, the OS type is already being displayed under "VM Configurations". With displaying the controller type, how would you like that displayed? especially for VMs w/multiple disks/etc. and under which section?

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

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".

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