vCheck (Daily Report) V3
Initially when I started this script I wanted people to be clear that this was a report that was going to give you a daily summary of any issues which may exist in your Virtual Infrastructure, from the beta testing I did to a select few it was clear that they were expecting this to send them a full inventory of their infrastructure.
That wasn’t the point in this script and I think people now have the idea that this is more of an issue log than an audit script so I will now revert to my original name of…. vCheck.
The key thing to remember is that if an issue does not exist in a particular area then it will not show in the output, when and if issues turn up they will start appearing in the output almost like magic !
I want to thank everyone who is using this script and those who have left a comment, even if its just to say how much you like it !
I especially want to thank Raphaël SCHITZ (http://www.hypervisor.fr/) for all his contributions, he has added some great features to this version and helped me take it to a new level.
The previous version already reported on these areas:
- 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 stored on local datastores
- 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
So what is added to V3 ?
Well firstly I have fixed some bugs which existed in V2 and made things slightly faster.
The other added features are as below:
- Status report to screen whilst running interactively
- At the top of the script you can now turn off any areas you do not want to report on (this makes it faster to run)
- VMs on Local storage has been changed to report 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)
- Added the number of issues to each title line
As always please let me know if you have any comments, I already have some great ideas that I could not fit into this version so watch out for V4 !
Also a reminder that this script also checks your Windows vCenter server for services and event logs, it does this via WMI and therefore needs the correct permissions, there is still an area at the top of the script which you can give alternate credentials from the account that is running the script if needed.
If your new to this script and would like more details on how it looks or how to run it please check this post.







about 4 months ago
thanks for the incredible script. would love to see datastore usage and configuration fleshed out a bit.
about 4 months ago
Hi Al,
Awesome script. Thanks again.
Is it possible to send to multiple email addresses? I have tried a pipe, semi-colon etc and I can’t get it to work. Email works OK to a single address.
Cheers.
about 4 months ago
@cxo
OK, had time to re-investigate. Line 485 should read: “$VIServer = Connect-VIServer $VISRV -Credential $creds”
about 3 months ago
Very impressive script, much appreciated!
about 3 months ago
CXO is right. This fixed my credential issues with running it as a scheduled task. Thanks to you and to Al for this awesome script!
about 2 months ago
Very good stuff – I was running vCheck 2 and decided to move to vCheck3.
I receive the following error when running the script – any ideas?
17:14 ..Checking Hosts Dead Lun Path
Item has already been added. Key in dictionary: ‘Misc.LogToFile’ Key being added: ‘Misc.LogToFile’
At :line:602 char:26
+ $esxluns = Get-ScsiLun <<<< -vmhost $esxhost |Get-ScsiLunPath
about 2 months ago
@Dan
Strange, Havent seen this before, do you have a funny storage layout, looks like you have two storage lun paths with the same details. – try a rescan of your hosts as a first measure.
about 2 months ago
Is there any way to save and trend the data from the report, specifically the overall counts and storage data?
about 2 months ago
Yes, you can do this with PowerCLI but I dont want to include that sort of thing in this report as yet, I have multiple other things I am working on including at the moment.
about 1 month ago
Hi, i seem to have the same issue which makes the script fail:i have tried to rescan also.
At :line:602 char:26
+ $esxluns = Get-ScsiLun <<<< -vmhost $esxhost |Get-ScsiLunPath
any ideas?
about 1 month ago
#10 (Answer)
Logged onto HOST through ILO and spotted that the HOST had a path error. Rebooted HOST (All OK, no errors) Updated Vsphere patches and now script works fine.
Cheers Chris
about 3 weeks ago
How do you set a VM to not be reported on? I tried adding a VM under the $LVMDoNotInclude = ” VM-name”. But Im still getting reports on the one. Thanks
about 3 weeks ago
Is there a way to send this to more than 1 email address? Getting a dist list setup in this environment is hard. Thanks, great script.
about 3 weeks ago
Yeah I think you can add a ; or a , to seperate the email addresses, should work, if not let me know !
about 3 weeks ago
@Travis
There is no Generic dont report on this VM, you would need to alter the code in the same way I have for the LVMDoNotInclude.
about 3 weeks ago
Using ; did not work, but using just a , worked fine. I left no spaces, not sure if that’s required or not. Thanks.
about 3 weeks ago
I used this edit to not show certain datastores that I knew would be low on space as they were sized specifically for certain volumes. You could probably do the same for excluding those VMs.
I defined this up in the Detail Setting section:
$NIQDSDoNotInclude = “whattoremove*”
And then here is the updated code for the datastore part:
Write-CustomOut “Collecting Datastore Objects”
$Datastores = Get-Datastore | Sort Name | Where { $_.Name -notmatch $NIQDSDoNotInclude }
about 1 week ago
Great work on the vCheck script!, and i need to get detail tasks/events.
Please help to suggest me.
about 5 days ago
I am getting an error on the send. Any idea what I am missing?
The term ’send-SMTPmail’ is not recognized as the name of a cmdlet, function, s
cript file, or operable program. Check the spelling of the name, or if a path w
as included, verify that the path is correct and try again.
At C:\temp\vCheckV3udiobtesx07.ps1:998 char:14
+ send-SMTPmail <<<< $EmailTo $EmailFrom "$VISRV Daily Report" $SMTPSRV $MyRep
ort
+ CategoryInfo : ObjectNotFound: (send-SMTPmail:String) [], Comma
ndNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
about 3 days ago
Strange, there should be a function of that name so I dont know why it is failing, I would try redownloading the code incase there was an issue there.