A quick update this time, mainly bug fixes but please see the change log below for more details.
[wpdm_file id=17]
As always you can find more information about vCheck and how to use this by visiting this page.
Change log
There are now over 70 plugins, some fantastic stuff, below is a list of items which have changed or been fixed since 6.0:
# v 6.15 – Added Category to all plugins and features to vCheckUtils script for Categorys.
# v 6.14 – Fixed a bug where a plugin was resetting the $VM variable so later plugins were not working 🙁
# v 6.13 – Fixed issue with plugins 63 and 65 not using the days
# v 6.12 – Changed Version to PluginVersion in each Plugin as the word Version is very hard to isolate!
# v 6.11 – Fixed a copy and paste mistake and plugin issues.
Reminder
If a plugin is not needed in your environment remove it from the plugins folder as it will speed up the execution of your script.
Script works fine on 2008 BUT NOT windows2012. It doesn’t connect to vcenter server says command not recognize
Hi Alan – after the hosts in maint mode — i would like to another field as to how long they have been in maint mode and their annotations – can you please guide how to do this
Hi, Alan , I ‘ve got a question here, why I receive no email from vCheck? which configuration should I double check ? Thanks , we use Exchange.
Hey guys,
its owesome, easy to use and very handy.
I am new in power shell , I have an error in get-view of my datasroes can anyone give me a hint I don’t know how to fix this problem.
10:26:33 AM Collecting Detailed Datastore Objects
Get-View : Cannot bind parameter ‘ViewType’. Cannot convert the “StoragePod” va
lue of type “System.String” to type “System.Type”.
At C:\Scripts\vCheck-Step-02\Plugins0 Connection Plugin for vCenter.ps1:118 c
har:45
+ $DatastoreClustersView = Get-View -viewtype <<<< StoragePod
+ CategoryInfo : InvalidArgument: (:) [Get-View], ParameterBindin
gException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,VMware.VimAutomat
ion.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView
Any one has any solution to the above problem ?
Awesome script…thanks for sharing this! I do see that the Windows Server 2012 R2 OS is still reported as just 2012 with the R2 part. Any way to fix that?
Hi,
vChecker is awesome!
Only thing is that plugin 63 does not pick up “Task: Remove all snapshots”. I’ve got around this by looking for “Remove” and “snapshots” instead. Thought this might be helpful to someone.
Success. Through some trial and error, Ken’s suggestions to add the Function Get-HTMLDetail… at line 170 of the original vcheck.ps1 script does work – provided that you close the foreach at the VERY end of vcheck.ps1 (took a min or two to figure that out).
Second, the disconnect-viserver $server -confirm:$false around line 218 before the if($SendAttachment) {
statement…..kinda worked.
I refashioned it with a little help to:
Write-customOut “..Disconnecting vCenter $Server”
disconnect-viserver * -confirm:$false
For some reason it was not (fully?) disconnecting from each server from the imported VNAMES.csv so I went with ” * ” to wildcard it. You do have to go back to GlobalVariables and #-out the $Server variable though. After that, it’s ran great.
Now I am going to try to find or create some plugins to capture environment information like CPU, MEM and Datastore utilizations.
How did this work for you? Going to give it a go this morning.
Also I left out the need to disconnect from the ESX host after the script runs because it will simply continue to count all the VMs etc and add them up. I put disconnect-viserver $server -confirm:$false on line 218. before if ($SendAttachement) It might be able to go somewhere else, but I am a rookie
I got this going by adding my Import-Csv to line 170 in vCheck.ps1 (just before the #adding all plugins) Don’t forget the } at the very end of the script to close it up. You also have to remove the $server variable from the GlobalVariables.ps1
Function Get-HTMLDetail ($Heading, $Detail){
$Report = ($HTMLDetail -replace “_Heading_”, $Heading) -replace “_Detail_”, $Detail
Return $Report
}
Import-Csv C:\scriptfolder\vCheck-vSphere-master\vmnames.csv | ForEach-Object {
Write-Host -ForegroundColor RED $_.myServer
$server = $_.myServer
# Adding all plugins
$TTRReport = @()
$MyReport = Get-CustomHTML “$Server vCheck”
$MyReport += Get-CustomHeader0 ($Server)
Hi, did you ever get a response to this? I’m looking to do the same thing.
Hi David, I’m also having the same issue. Running the script against a specific VC for the first time. Hangs at that point. I’m going to try an older version of the script, see if that works.
Hi Alan, or others! I’ve running this version of vCheck but am issues where the Snapshot plugins seem to ignore the exclusion ID. Therefore all my Veeam backup snapshots are listed. I’ve tried using case sensitive and case insensitive but without success. THanks
Seem to be having the same issue with the Snapshot plugin – Can anyone shed any light?
Cheers.
Initially I had no problems with the script, but now I seem to be having a problem with 02 Snapshot Information.ps1. It throws an error for missing VM’s; four of them from what I can see. Indeed, these VM’s don’t show in a Get-VM, so why is 02 Snapshot Information.ps1 finding remnants of them, how would I clean them out?
Get-View : 8/30/2012 11:29:38 AM Get-View View with Id ‘VirtualMachine-vm-2576’ was not found on the server(s).
At H:\VMware\Scripts\vCheck\vCheck\Plugins2 Snapshot Information.ps1:88 char:18
+ $vm = Get-View <<<< $_.Entity
+ CategoryInfo : ObjectNotFound: (:) [Get-View], VimException
+ FullyQualifiedErrorId : Core_GetView_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView
I have searched and searched for similar errors online, but have only come accross this post and it seems as though nobody has addressed this particular error. If anyone has any ideas, please let me know. I need to get the Snapshot info for some reports and this is preventing me from compiling my reports.
Script seems to hang on 02 Snapshot Information.ps1, No error or anything… it just sits there 😐 Everything else works awesome!! Any Ideas? Thanx for creating it
Hi Alan
Can you please let us know how this can be run against multiple VCenter servers and get the results in one hit? this has been an FAQ and so many people have asked the same question… it would be so helpful if you can guide us through how this ca be done
Hi, love your script. I’m getting the error of VM’s not existing on the server. What could be the root cause of this?
any help would be greatly appreciated.
Get-View : 2012-05-10 04:20:01 PM Get-View View with Id ‘VirtualMach
ine-vm-14536’ was not found on the server(s).
At C:\Scripts\vCheck\Plugins2 Snapshot Information.ps1:88 char:18
+ $vm = Get-View <<<< $_.Entity
+ CategoryInfo : ObjectNotFound: (:) [Get-View], VimException
+ FullyQualifiedErrorId : Core_GetView_WriteNotFoundError,VMware.VimAutoma
tion.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView
Alan, fantastic work yet again!
I’ve just upgraded from 6.0 straight to 6.15.
Two things I’ve noticed; It’s reporting 1 cluster, but we have 0 set up (I’d overlooked this in 6.0). And Power Supply Failure warnings on one of these hosts where vSphere sees they are fine.
Any advice?
RE: Rob’s comment from March 28, 2012 at 11:05
“Tried to figure out how to only show plugins that is out of date since not installed is not that relevant is it?!”
I agree that I don’t want to see plugins that aren’t installed (Like Exchange) as they are not relevant to our envirnment.. Have used my *very* rudimentary scripting skills to try and figure out where I can disable that so I only see out of date plugins but no joy.
Anyone else figure this out yet?
Thanks
-Randy-
Hi Alan,
Long time hope all is well =)
I tried to make a plugin for this vCheck to report on vSphere hosts with nics running at 100mb. The plugin itself works but does not appear in the report. Can you advise? Here is what I have done.
# Start of Settings
# End of Settings
$vshost = Get-VMHost -Location “*****” | Get-View
Foreach ($objectitem in $vshost)
{
$pnic = $objectitem.Config.Network.Pnic
foreach
($nic in $pnic)
{
if ($nic.LinkSpeed.SpeedMb -eq 100) {$rep = Write-Host $nic.Device “on vSphere server” $objectitem.Name “is running at” $nic.LinkSpeed.SpeedMb”mb” }
}
}
$rep
$Title = “100mb Nic”
$Header = “100mb Nic”
$Comments = “vSphere hosts with nic’s running at 100mb”
$Display = “Table”
$Author = “Gordon Grant”
$PluginVersion = 1.0
$PluginCategory = “vSphere”
Alan,
I saw your script and I like what it does and I think it would make my lofe easier. I tried it and I get a lot of error on some scripts saying that it is not degitally signed. I’m new to poweshell, what can i do to resolve the issue.
Everything in the latest version of the vCheck works great accept for plugin 68. I get this error:
Get-Stat : 4/5/2012 11:15:09 AM Get-Stat Object reference not set to
an instance of an object.
At D:\files\vmware\scripts\vcheck\retail\Plugins\68 Disk Max Total Latency.ps1:
12 char:37
+ $VHHMaxLatency = $VMHost | get-stat <<<< -stat "disk.maxTotalLatency.lat
est" -start ($Date).addhours(-$stattotallatency) -finish ($Date)|?{$_.value -gt
$diskmaxtotallatency}|sort Timestamp -Descending
+ CategoryInfo : NotSpecified: (:) [Get-Stat], VimException
+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomatio
n.ViCore.Cmdlets.Commands.GetViStats
Any ideas?
I’m writting a plugin but I get confused on how to send result to vCheck ?
all is in a variable and I do : $myvariable as I’ve seen on many plugins, but it display strange thing :
PSPath PSParentPath PSChildName PSDrive PSProvider PSIsContainer VersionInfo BaseName Mode Name Length DirectoryName Directory IsReadOnly Exists FullName Extension CreationTime CreationTimeUtc LastAccessTime LastAccessTimeUtc LastWriteTime LastWriteTimeUtc Attributes
Microsoft.PowerShell.Core\FileSystem::C:\vCheck6\Plugins\vmtools.versions Microsoft.PowerShell.Core\FileSystem::C:\vCheck6\Plugins vmtools.versions C Microsoft.PowerShell.Core\FileSystem False File: C:\vCheck6\Plugins\vmtools.versions InternalName: OriginalFilename: FileVersion: FileDescription: Product: ProductVersion: Debug: False Patched: False PreRelease: False PrivateBuild: False SpecialBuild: False Language: vmtools -a— vmtools.versions 746 C:\vCheck6\Plugins C:\vCheck6\Plugins False True C:\vCheck6\Plugins\vmtools.versions .versions 30.03.2012 15:23:58 30.03.2012 13:23:58 30.03.2012 15:23:58 30.03.2012 13:23:58 05.04.2012 10:03:01 05.04.2012 08:03:01 Archive
Help is welcome !!!
I found the solution to the plugin 18 problem. The plugin only works correct if the AdmissionControlPolicy is ClusterFailoverLevelAdmissionControlPolicy. Or in other words, if you selected “Host failures cluster tolerates” as Admission Control Policy in the vSphere client.
In the plugin I modified the following line to check also if Admission Control Policy is enabled and for the right Admission Control Policy:
If ($Cluster.ExtensionData.Configuration.DasConfig.Enabled -eq $true) {
into:
If ($Cluster.ExtensionData.Configuration.DasConfig.Enabled -eq $true -and
$Cluster.ExtensionData.Configuration.DasConfig.AdmissionControlEnabled -eq $true -and
$Cluster.ExtensionData.Configuration.DasConfig.AdmissionControlPolicy.GetType().Name -eq “ClusterFailoverLevelAdmissionControlPolicy”){
Hello,
Seem to get this error when I run the report. Do any of you have any suggestionsthat I could try?
the 6.10 report work fine, but this 6.15 version seems to give me an error.
Get-View : 04/04/2012 13:03:50 Get-View View with Id ‘VirtualMachine
-vm-47546’ was not found on the server(s).
At C:\Documents and Settings\ripped01\Desktop\powershell\New Script\unzipped\Pl
ugins2 Snapshot Information.ps1:88 char:18
+ $vm = Get-View <<<< $_.Entity
+ CategoryInfo : ObjectNotFound: (:) [Get-View], VimException
+ FullyQualifiedErrorId : Core_GetView_WriteNotFoundError,VMware.VimAutoma
tion.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView
Get-View : 04/04/2012 13:03:52 Get-View View with Id 'VirtualMachine
-vm-47546' was not found on the server(s).
At C:\Documents and Settings\ripped01\Desktop\powershell\New Script\unzipped\Pl
ugins2 Snapshot Information.ps1:88 char:18
+ $vm = Get-View <<<< $_.Entity
+ CategoryInfo : ObjectNotFound: (:) [Get-View], VimException
+ FullyQualifiedErrorId : Core_GetView_WriteNotFoundError,VMware.VimAutoma
tion.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView
Same problem as Jon Walmsley on March 13, 2012 at 09:42: When I run 6.15 against one of my vCentre instances, the scripts gets stuck at
..finished calculating General Information by Alan Renouf, Frederic Martin v1.1
Any help much appreciated, thank you
Jon Walmsley says:
March 13, 2012 at 09:42
Hi,
When I run 6.15 against one of my vCentre instances, the scripts gets stuck at
..finished calculating General Information by Alan Renouf, Frederic Martin v1.1
Any ideas as to why, it works on another vCentre instance.
Regards,
Plugin “18 Cluster Slot Sizes.ps1” doesn’t work with vSphere v4.1U2 clusters. The $SlotDetails variable doesn’t have TotalSlots and UsedSlots properties. See the example:
PowerCLI C:\users\robert> $SlotDetails = $Cluster.ExtensionData.RetrieveDasAdvancedRuntimeInfo()
PowerCLI C:\users\robert> $SlotDetails | fl *
DasHostInfo : VMware.Vim.ClusterDasAamHostInfo
HeartbeatDatastoreInfo :
DynamicType :
DynamicProperty :
I don’t know how to fix this problem.
I noticed that plugin “46 Missing ESX patches.ps1” only returns one ESX server. I modified the plugin by adding a new line at the beginning of the script:
$Results = @()
And I changed the line:
$Results = $baseline.NotCompliantPatches |
into:
$Results += $baseline.NotCompliantPatches |
Good day Alan, your script is excellent, thank you very much. My company is in the process of migrating to a new monitoring system, and this is an excellent backup to make sure nothing is missed. I made a brief post going over setting up for multiple customer vCenters and getting the scheduled task to run successfully at the address below. Cheers!
http://cosonok.blogspot.com/2012/04/setting-up-monitoring-system-to-run.html
Thanks a lot of the excellent script! We have been (…err is) using a old one for quite some time and it works very well. Now, I’m looking into the v6 version.
Some things that not that related to the vCheck itself, more to the plugins:
Seems that the “Plugins Not up to date or installed” link under the plugins is dead (404).
Tried to figure out how to only show plugins that is out of date since not installed is not that relevant is it?!
I’ve downloaded v6.15, seems the plugin is quite old (v1.1?), that’s why I tried to download the latest one…. and hoping for a out of date thingy =)
//Rob
Where’d the previous versions links go? The new plugin for snapshots which includes creator does not work for me, and I don’t care about that column — would like to revert to the previous version of the snapshot plugin but I cannot find it anywhere to download. Is it still available anywhere?
Thanks!
are you aware if someone has dusted off the “Workstation & Server Audit Script V3” script using Alan’s the latest vCheck version as a framework? Noticed Exchange 2010 version but you had mentioned Active Directory, SQL or Server would also be nice currently a mix of powershell, vb and bat scripts for audit reports. I have been using a modified version of the Alan’s Server Audit script for sometime.
Workstation & Server Audit Script V3
Thanks Michael, good call.
Alan and plugin writers, great script.
We noticed that sometimes there were double entries in the report. This was due to a plugin that crashes. Then the output of the previous login was added again. Workaround is initializing the $Details around line 343 of vCheck.ps1 like:
$Plugins | Foreach {
$Details = $null
I’ve got a little bug with version 6.15. In the report all datastore have a capacity and freespace of 0Gb. But the percentage is correct. During the execution I see the following error.
Have you some idea?
Thanks
10:10:32 ..finished calculating Syslog Name by Jonathan Medd v1,1
Get-Datastore : Cannot validate argument on parameter ‘Datacenter’. The argument is null or empty. Supply an argument t
hat is not null or empty and then try the command again.
At D:\Scheduled Tasks\15 VmWare2 Daily Report\Plugins\52 Datastore Consistency.ps1:8 char:55
+ $Datastores = $VMHosts | Get-Datastore <<<<
+ CategoryInfo : InvalidData: (:) [Get-Datastore], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetDatasto
re
Get-Datastore : Cannot validate argument on parameter 'Datacenter'. The argument is null or empty. Supply an argument t
hat is not null or empty and then try the command again.
At D:\Scheduled Tasks\15 VmWare2 Daily Report\Plugins\52 Datastore Consistency.ps1:9 char:104
+ $problemDatastores = $VMHosts | ForEach {Compare-Object $Datastores ($_ | Get-Datastore <<<< )} | For
Each {$_.InputObject} | Sort Name | Select @{N="Datastore";E={$_.Name}},@{N="Cluster";E={$Cluster.Name}} -Unique
+ CategoryInfo : InvalidData: (:) [Get-Datastore], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetDatasto
re
Compare-Object : Cannot bind argument to parameter 'ReferenceObject' because it is null.
At D:\Scheduled Tasks\15 VmWare2 Daily Report\Plugins\52 Datastore Consistency.ps1:9 char:72
+ $problemDatastores = $VMHosts | ForEach {Compare-Object <<<< $Datastores ($_ | Get-Datastore)} | For
Each {$_.InputObject} | Sort Name | Select @{N="Datastore";E={$_.Name}},@{N="Cluster";E={$Cluster.Name}} -Unique
+ CategoryInfo : InvalidData: (:) [Compare-Object], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CompareObje
ctCommand
10:10:40 ..finished calculating Datastore Consistency by Robert Sexstone v1,1
Alan – the only errors I get are certificate issues, but that normally does not cause any issues with the email being sent. The html page displays perfect at the end of the script. Are there logs I should be looking at?
Looks great, I set $TimeToRun = $false in GlobalVariables.ps1 yet it still reports on the end. Is there somewhere else I need to set it to false?
Sam, any errors ?
Thanks Alan, I have upgraded my testing platform and running now.
James, no PowerCLI 5.0.1 is backward compatible to ESX 3.5
After updating to 6.15 I am no longer able to email the report. I am specifying the same SMTP address and same email addresses in the config… any ideas?
Thanks Alan, will this cause an issue since we have a 4.1 environment? Also, thanks for the work on this, it has helped me make our environment run well.
James, you need to update to PowerCLI 5.0.1
Hi Alan, just wanted to say I love the script. We have been using it since V1.12 and it has really made life easier in managing our VM Farm. Keep up the GREAT work!
For our use I have only had to make one ‘tweak’ to the NoTools check so that it also shows the VMs with OldTools.
I’ve just added -Or $_.Guest.ToolsStatus -eq “toolsOLD” to the end of the check in module 26 to get the desired results.
Thanks again!!
Mark
Plugin 03 Datastore Information returns 0 values for CapacityGB and FreespaceGB, although PercentFree displays properly for me. Any suggestions as I dont see an error in the script.
We need a plugin to publish the report to a SharePoint site.
Alan,
A couple quick questions for you.
1) On the “snapshot oversize” plugin, what does the “RealSize” column indicate? My thought would be snapshot size but when I look in the datastore browser, I am not seeing snapshots the same size as the report indicates.
2)Can you help me understand what the “Disk Max Total Latency” report is displaying? The default value is 50 and several hosts are listed. Are these just hosts that have over 50milsec latency to any of its LUNs?
Thanks in advance!
sorry,
on the vCentre the script completes on we do get an error about machines not exsiting on the server. Any ideas?
Get-View : 13/03/2012 09:41:00 Get-View View with Id ‘VirtualMachine-vm-1699’ was not found on the server(s)
.
At D:\Utilities\vCheck\vCheck\Plugins2 Snapshot Information.ps1:88 char:18
+ $vm = Get-View <<<< $_.Entity
+ CategoryInfo : ObjectNotFound: (:) [Get-View], VimException
+ FullyQualifiedErrorId : Core_GetView_WriteNotFoundError,VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInter
op.GetVIView
Regards
Hi,
When I run 6.15 against one of my vCentre instances, the scripts gets stuck at
..finished calculating General Information by Alan Renouf, Frederic Martin v1.1
Any ideas as to why, it works on another vCentre instance.
Regards,
Not sure I understand the intention of the -Outputpath option with the new $ArchiveFilePath code…The sequence of if statements first creates the archived file, and then emails the report, but if there’s an attachment then it deletes the archived file? What’s the point of specifying -Outputpath if the file just gets deleted afterwards?
Sven, The plugins code would need to be adjusted to do this, it isn’t something I have baked into the code.
Hi Alan,
thank you so much for this nice script. But one question…. can i now specified a Cluster and/or Datacenter?
Regards and thanks!
Sven
Also any update on the sendemail function on vcheck 6.15.
To Send the Email we added the OLD String from Vcheck5 and it worked
function Send-SMTPmail($to, $from, $subject, $smtpserver, $body) {
$mailer = new-object Net.Mail.SMTPclient($smtpserver)
$msg = new-object Net.Mail.MailMessage($from,$to,$subject,$body)
$msg.IsBodyHTML = $true
$mailer.send($msg)
}
if ($SendEmail) {
Write-CustomOut “..Sending Email”
send-SMTPmail $EmailTo $EmailFrom “$VIServer vCheck Report” $SMTPSRV $MyReport
}
Below is the error we get
send-mailmessag : MailBox unavailable. The server respone was: 5.7.1 Client dies bit have permissions to send as this sender.
If you want to run the script against multiple vSphere environments without repackaging the script collection for each target, you can add a variable to line 1 of vCheck.ps1 like such:
param ([Switch]$config, $Outputpath, $vSphere)
Then in GlobalVariables.ps1 make sure you set
$Server = $vSphere
To execute it, just run
./vCheck.ps1 -vSphere [virtualcenterhostname]
There’s probably a cleaner or more elegant way to do this, but this worked for us. Just be aware that it means your report (thresholds, included plugins, etc) will of course be the same for all environments. (I run all my various prod environments this way, and then have a separate repackaged version for my dev/test environments.)
Hi all,
Fairly new to all this, so please bare with me.
Been running the 6.0 script, which has been great in spotting all types of config issues.
I have now tried to run 6.15 script but get one of the following errors:
Any help would be greatly appreciated, as previous versions of this script have been a real help.
Output from script:
15:50:40 Connecting to VI Server
WARNING: There were one or more problems with the server certificate:
* A certification chain processed correctly, but terminated in a root
certificate which isn’t trusted by the trust provider.
* The X509 chain is not valid due to an invalid time value, such as a value
that indicates an expired certificate.
* The certificate’s CN name does not match the passed value.
Certificate: [Subject]
E=support@vmware.com, CN=VMware, OU=”VMware, Inc.”, O=”VMware, Inc.”, L=CA,
S=CA, C=US
[Issuer]
E=support@vmware.com, CN=VMware, OU=”VMware, Inc.”, O=”VMware, Inc.”, L=CA,
S=CA, C=US
[Serial Number]
00D6CC9D78F631DDD0
[Not Before]
10/08/2009 14:02:38
[Not After]
10/08/2011 14:02:38
[Thumbprint]
A5B354AC4DE3B2E684A4A0EE8B3C0285C9E96AD7
The server certificate is not valid.
WARNING: THE DEFAULT BEHAVIOR UPON INVALID SERVER CERTIFICATE WILL CHANGE IN A
FUTURE RELEASE. To ensure scripts are not affected by the change, use
Set-PowerCLIConfiguration to set a value for the InvalidCertificateAction
option.
15:51:00 Adding Custom properties
15:51:00 Collecting VM Objects
15:51:05 Collecting VM Host Objects
15:51:08 Collecting Cluster Objects
15:51:09 Collecting Datastore Objects
15:51:09 Collecting Detailed VM Objects
15:51:18 Collecting Template Objects
15:51:19 Collecting Detailed VI Objects
15:51:19 Collecting Detailed Alarm Objects
15:51:19 Collecting Detailed VMHost Objects
15:51:34 Collecting Detailed Cluster Objects
15:51:35 Collecting Detailed Datastore Objects
15:51:35 ..finished calculating Connection settings for vCenter by Alan Renouf v
1.3
15:55:31 ..finished calculating General Information by Alan Renouf, Frederic Mar
tin v1.1
Get-View : 09/03/2012 16:12:55 Get-View View with Id ‘VirtualMachine
-vm-47546’ was not found on the server(s).
At C:\Documents and Settings\ripped01\Desktop\powershell\New Script\Plugins2
Snapshot Information.ps1:88 char:18
+ $vm = Get-View <<<< $_.Entity
+ CategoryInfo : ObjectNotFound: (:) [Get-View], VimException
+ FullyQualifiedErrorId : Core_GetView_WriteNotFoundError,VMware.VimAutoma
tion.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView
Get-View : 09/03/2012 16:12:58 Get-View View with Id 'VirtualMachine
-vm-47546' was not found on the server(s).
At C:\Documents and Settings\ripped01\Desktop\powershell\New Script\Plugins2
Snapshot Information.ps1:88 char:18
+ $vm = Get-View <<<< $_.Entity
+ CategoryInfo : ObjectNotFound: (:) [Get-View], VimException
+ FullyQualifiedErrorId : Core_GetView_WriteNotFoundError,VMware.VimAutoma
tion.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView
Get-View : 09/03/2012 16:17:35 Get-View View with Id 'VirtualMachine
-vm-47548' was not found on the server(s).
At C:\Documents and Settings\ripped01\Desktop\powershell\New Script\Plugins2
Snapshot Information.ps1:88 char:18
+ $vm = Get-View <<<< $_.Entity
+ CategoryInfo : ObjectNotFound: (:) [Get-View], VimException
+ FullyQualifiedErrorId : Core_GetView_WriteNotFoundError,VMware.VimAutoma
tion.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView
Get-View : 09/03/2012 16:22:12 Get-View View with Id 'VirtualMachine
-vm-47548' was not found on the server(s).
At C:\Documents and Settings\ripped01\Desktop\powershell\New Script\Plugins2
Snapshot Information.ps1:88 char:18
+ $vm = Get-View <<<< $_.Entity
+ CategoryInfo : ObjectNotFound: (:) [Get-View], VimException
+ FullyQualifiedErrorId : Core_GetView_WriteNotFoundError,VMware.VimAutoma
tion.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView
Now we have a mixed environment of ESX versions and connectivity so I wasn’t too alarmed at the errors so I didn’t post, but here are they:
9:29:10 AM ..finished calculating Cluster Node version by Raphael Schitz, Frederic Martin v1.1
Attempted to divide by zero.
At E:\scripts\vcheck-new\Plugins\71 Capacity Planning.ps1:25 char:36
+ $VmCpuAverage = $CluCpuUsageAvg/ <<<< (Get-Cluster $cluv.name|Get-VM).count
+ CategoryInfo : NotSpecified: (:) [], RuntimeException
+ FullyQualifiedErrorId : RuntimeException
Attempted to divide by zero.
At E:\scripts\vcheck-new\Plugins\71 Capacity Planning.ps1:36 char:36
+ $VmMemAverage = $CluMemUsageAvg/ <<< System.Net.Sockets.SocketExcept
ion: A connection attempt failed because the connected party did not properly respond after a period of time, or establ
ished connection failed because connected host has failed to respond 10.15.0.34:8080
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAdd
ress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
— End of inner exception stack trace —
at System.Net.WebClient.OpenRead(Uri address)
at OpenRead(Object , Object[] )
at System.Management.Automation.DotNetAdapter.AuxiliaryMethodInvoke(Object target, Object[] arguments, MethodInforma
tion methodInformation, Object[] originalArguments)
At E:\scripts\vcheck-new\Plugins\Plugins Not up to date or installed.ps1:11 char:34
+ $NotInstalled = Get-vCheckPlugin <<<< -NotInstalled | Select Name, version, Status, Description
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-VCheckPlugin
John, care to post the errors so I can see whats going on please ? Thanks.
Also, in plugin 19 “Guests with less than X MB free”, would it be possible to add an exclusion option that matches against the DiskPath property? For example, on our Linux VMs the /boot partition is quite small to start, so there’s always very little free space.
To achieve this, I added the variable $DiskExclude =”/boot”, then I modified the if condition with “-and ($disk.DiskPath -notmatch $DiskExclude)”
Not sure if the code will paste in, but here’s the if line:
if ((([math]::Round($disk.FreeSpace / 1MB)) -lt $MBFree) -and ($disk.DiskPath -notmatch $DiskExclude)){
Thanks,
-Loren
Some great additions. I getting errors with the cluster node and quickstats module but the report is looking great. Thank you very much!
Well, I was setting it up manually, mostly because I was just used to doing it that way. But I just went through the -config setup and that was easier for the bulk of it.
Here’s what I’ve been tweaking:
– Make sure the script works when executed remotely by an unprivileged service account
– Send report embedded in the email body as well as an attachment.
– Add or rearrange information in header output of a few plugins to make them more friendly
– Remove plugins that we don’t need
– Identify and repair (or remove) plugins that don’t seem to be working properly (such as the # of days on the snapshots removed/created plugins)
— btw, the ‘LastPoweredOffDate’ field doesn’t seem to exist for all VMs?
– Repackage for consistent deployment across 12+ separate virtual environments
Hi Alan,
thanks, that did the Trick.
Mark
Loren, Several Hours ?! please can you explain what you do here ?
When there is a new version you should just be able to run vCheck -config and add the settings in you like?
Mark, by default scripts you download from the internet are blocked to run which is why it is prompting you, you have 2 options…
1. When you have downloaded the vCheck.Zip file, right click it and choose properties and then click the unblock button
2. Go through the plugin files which are prompting you and right click them and choose properties and click the unblock button
I am not sure and it looks more like a windows support question but as linux user, i am wondering how you are able to run this scrip automaticly. I get ask on every third Plugin if i want to run this script.
The only “solution” google provides ist to deaktivate uca? Does’t every body deaktivaete it by default?
Thanks,
Mark
Yeah, I’m not sure what the right answer is. But right now, with every update it takes me several hours to go through and test and tweak the various plugins to get it working the way I’d like.
I know what you mean but you should be able to run “./check.ps1 -config” to run through the setup wizard again, i don’t want to put them in global variables as I won’t know what plugins you have installed, the report will not be generic and usable by any powershell snap-in/module and will also restrict changing the plugins and data required, this way new plugins can be downloaded without the vCheck base script and easily added.
Would it be possible to move the variables defined in the plugins into the GlobalVariables.ps1 file? It’s kind of a pain to update all the individual plugin files whenever there’s a new version of the report. Not to be ungrateful, of course, I love this thing and appreciate all the work you’ve put into it! 🙂