vCheck is a PowerShell HTML framework script, the script is designed to run as a scheduled task before you get into the office to present you with key information via an email directly to your inbox in a nice easily readable format.
This script picks on the key known issues and potential issues scripted as plugins for various technologies written as PowerShell scripts and reports it all in one place so all you do in the morning is check your email.
One of they key things about this report is if there is no issue in a particular place you will not receive that section in the email, for example if there are no datastores with less than 5% free space (configurable) then the disk space section in the virtual infrastructure version of this script, it will not show in the email, this ensures that you have only the information you need in front of you when you get into the office.
This script is not to be confused with an Audit script, although the reporting framework can also be used for auditing scripts too. I don’t want to remind you that you have 5 hosts and what there names are and how many CPU’s they have each and every day as you don’t want to read that kind of information unless you need it, this script will only tell you about problem areas with your infrastructure.
What’s new in 6.0
vCheck 6.0 has been updated to be more community driven and easier to expand, the checks have been removed and put into separate plugins which make it easier for people to contribute.
The HTML output has been reformatted to work with newer versions of Outlook.
A Setup Wizard has been added for easy setup and no more need to reference the vCenter address as a parameter of the script.
As the plugins have been moved out it makes this HTML report framework easy to adapt to other PowerShell enabled products like VMware vCD, Sharepoint, Exchange, vShield, VMware View, SQL, Active Directory and more. – please contact me if your interested to start your own using this template.
A header image has been added to the HTML report.
And much much more.
All scripts are now available via Github and can be modified as part of the Github website where I will approve the changes after checking, this enables everyone to get involved and add new features fast!
It also enables people to log issues in an easy way and control when they are fixed. Please do log your issues on the site rather than a comment on my blog.
To download the script check out the below example screenshot and click the “Download Zip” for each of the versions of vCheck, download links follow in this page for each of the versions.
Currently there is a vCheck report for each of the following areas:
|Download Link||Example Output Page|
|vCheck for vSphere||Click here|
|vCheck for Exchange 2010||Click here|
|vCheck for vCD||Coming soon|
|vCheck for SCVMM||Click here|
|vCD Audit script||Click here|
What is checked for in the vSphere version ?
The following items are included as part of the vCheck vSphere download, they are included as vCheck Plugins and can be removed or altered very easily by editing the specific plugin file which contains the data. vCheck Plugins are found under the Plugins folder.
- General Details
- Number of Hosts
- Number of VMs
- Number of Templates
- Number of Clusters
- Number of Datastores
- Number of Active VMs
- Number of Inactive VMs
- Number of DRS Migrations for the last days
- Snapshots over x Days old
- Datastores with less than x% free space
- VMs created over the last x days
- VMs removed over the last x days
- VMs with No Tools
- VMs with CD-Roms connected
- VMs with Floppy Drives Connected
- VMs with CPU ready over x%
- VMs with over x amount of vCPUs
- List of DRS Migrations
- Hosts in Maintenance Mode
- Hosts in disconnected state
- NTP Server check for a given NTP Name
- NTP Service check
- vmkernel warning messages ov the last x days
- VC Error Events over the last x days
- VC Windows Event Log Errors for the last x days with VMware in the details
- VC VMware Service details
- VMs stored on datastores attached to only one host
- VM active alerts
- Cluster Active Alerts
- If HA Cluster is set to use host datastore for swapfile, check the host has a swapfile location set
- Host active Alerts
- Dead SCSI Luns
- VMs with over x amount of vCPUs
- vSphere check: Slot Sizes
- vSphere check: Outdated VM Hardware (Less than V7)
- VMs in Inconsistent folders (the name of the folder is not the same as the name)
- VMs with high CPU usage
- Guest disk size check
- Host over committing memory check
- VM Swap and Ballooning
- ESXi hosts without Lockdown enabled
- ESXi hosts with unsupported mode enabled
- General Capacity information based on CPU/MEM usage of the VMs
- vSwitch free ports
- Disk over commit check
- Host configuration issues
- VCB Garbage (left snapshots)
- HA VM restarts and resets
- Inaccessible VMs
Now follow the video below to set up the vCheck script.
vCheck has been designed to add output from any script (.ps1 file) in the plugins folder, each one of these will be run in numerical or alphabetical order and the output included in the vCheck report. If you are not interested in the information for one of the checks it is highly recommended you remove the file as this will make the report faster.
For a great way to manage these make sure you check out Jake’s post here, he will show you how to use PowerCLI to easily check for new plugins and plugins which you do not have installed, you can even install them in a single command.
The Header.jpg in the root of the vCheck folder will be used and displayed in the title bar of the report (unless your email client does not support embedded base64 encoded images), this can be replaced with any image file of your choice but it is advised you stick to the same length and width as the current image.
A selection of headers can be found on the Headers page of this site.
Prerequisites for vSphere version of vCheck
The following will need to be installed for you to run this script and report on your VMware environment:
- PowerShell V2
- PowerCLI 5.01 or later version
- vCenter 2.5 or later version
Configuring the script
The first time you run this script it will go through a configuration menu, this configuration will be saved and used for all future runs of the script. If you want to go back through the configuration or you add new plugins to the script then please run the script with the –config parameter as follows:
Some people like to save a copy of the HTML for future reference or so they can go back and see when a problem started happening, to do this use the –OutputPath parameter and specify a location where the HTML will be saved, to do this run the script as follows:
.\vCheck.ps1 –OutputPath C:\vCheckOutput\DailyReports
Running the script
The following video will show how to run the script for the first time and any subsequent runs after this:
Adjusting connection information
In some cases you will need to adjust the connection information used by the connect-viserver cmdlet to connect to your vCenter, this can be adjusted through the config wizard or if extra credentials are needed please edit the GlobalVariables.ps1 file on line 40 as below:
$VIConnection = Connect-VIServer $VIServer
$VIConnection = Connect-VIServer $VIServer –user “AlternateUsername” –Pass “Alternatepassword” –Protocol Https
Want to learn more about the vCheck Project? Recently I spoke about it at the PowerShell Summit, you can watch the video here:
Q. How do I add multiple Email recipients ?
A. Edit the Global Variables.ps1 file and replace the line starting $EmailTo to the following:
$EmailTo ="email@example.com", "firstname.lastname@example.org"