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.

The script can be downloaded from here

Alan

Alan Renouf has a role of Automation Frameworks Product Manager at VMware responsible for providing the architects and operators of the cloud infrastructure with the toolkits/frameworks and command-line interfaces they require to build a fully automated software-defined datacenter. Alan is a frequent blogger at http://blogs.vmware.com/vipowershell and has a personal blog at http://virtu-al.net. You can follow Alan on twitter as @alanrenouf.

You may also like...

86 Responses

  1. nishant says:

    is there any script which will list all the Virtual machine in the vcenter with power state, ESXi host name and clustername and send email daily

  2. Michael Millard says:

    This is an amazing piece of code. I was hoping it would notify me of any Windows Servers with License issues, that are not correctly activated but holy cow it does so much very well.

  3. Brilliant use of correct HTML mark up. Report is just what I needed.

    As a blind user of VSphere I find it very difficult to get this kind of information at a glance. This report makes my life a lot easier.

    Would you be willing to make a report detailing network and storage configuration?

    Well done again!

  4. sjohn777 says:

    question on the VM Tools Issues listing…..it is flagging issues on a handfull of VM’s i have, but when i look in vCenter it states the tools are fine and running…..so i’m not sure what the script is checking or what in particular is the issue. any way this can be broken out into more granular issues presented – or an output of the actual issue found? that would be very helpful.

  5. sjohn777 says:

    great script. one issue i see is that the VM hardware old query isn’t using the version per host/cluster but the highest hardware version available….for example i have multiple clusters and some are still running esx 3.5 and the correct hardware version for those clusters is v4, but the script flags all of them as old because it wants all the VM’s to be at v7.

  6. Rusty says:

    This script is magic! A question on setting multiple NTP servers. What is the separator? Is it a semicolon, a comma or a space?

    Thanks again!

  7. Nenad Muzic says:

    Is it enough for user which runs this script to have Read-only role permission on vCenter?

  8. stefan müller says:

    and thanks for this great script.. :)

  9. stefan müller says:

    at line 1075:

    if (([math]::Round($disk.Capacity/ 1MB)) -lt $MBFree){

    i think correct is:

    if (([math]::Round($disk.FreeSpace/ 1MB)) -lt $MBFree){

    ?? 😉

  10. David says:

    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

    • Virtu-Al says:

      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.

  11. tong says:

    Great work on the vCheck script!, and i need to get detail tasks/events.
    Please help to suggest me.

  12. Mike says:

    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 }

  13. Mike says:

    Using ; did not work, but using just a , worked fine. I left no spaces, not sure if that’s required or not. Thanks.

  14. Virtu-Al says:

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

  15. Virtu-Al says:

    Yeah I think you can add a ; or a , to seperate the email addresses, should work, if not let me know !

  16. Mike says:

    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.

  17. Travis says:

    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

  18. Chris says:

    #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

  19. Chris Fegan says:

    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?

  20. Virtu-Al says:

    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.

  21. db says:

    Is there any way to save and trend the data from the report, specifically the overall counts and storage data?

  22. Virtu-Al says:

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

  23. Dan says:

    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

  24. Bigsofa says:

    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!

  25. Michael de Bruin says:

    Very impressive script, much appreciated!

  26. CXO says:

    @cxo

    OK, had time to re-investigate. Line 485 should read: “$VIServer = Connect-VIServer $VISRV -Credential $creds”

  27. Grasshopper says:

    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.

  28. mko says:

    thanks for the incredible script. would love to see datastore usage and configuration fleshed out a bit.

  29. cxo says:

    @cxo
    Again my PS savvy-ness is not great, but I came across a solution, almost from this URL: http://powershellcommunity.org/Forums/tabid/54/aff/5/aft/4295/afv/topic/afpg/1/Default.aspx
    I could not use “$creds.Password”, but everything else worked when I put in “-Passwrd Clear-Text-PW”. So solution is not complete, but getting closer. Thoughts?

  30. cxo says:

    Liking version 3, Al. One “issue”… I am not a power shell expoert, but line 485 appears to be incorrect ($VIServer = Connect-VIServer $VISRV). Since different credentials could be set (i.e. not use logged in user/domain), it apepars more arguments should be supplied here (I have crashed and burned updating it myself). Thoughts?

    Charlie

  31. bitsorbytes says:

    @bitsorbytes
    Ignore that… just seen vCheck 3.1 posting…. doh! :)

  32. bitsorbytes says:

    oh no…. The bug I reported for NTP checks if you have multi NTP servers didn’t make it into this version… (strange with all these daily checks etc, you only have 1 NTP configured in your environment??)

    Any chance it can make it into V4, explain code on how to fix it was provided in the v2 section.

  33. Caipirinha says:

    Hi Alan,
    first of all I would like to say that you do a good job and your scripts help us to do our work better!

    I find your new feature “Dead Lun Path” grate, but maybe there is a Bug.
    The script told me that we have a problem with some vmhbas.

    esx2f1.douglas-informatik.de vmhba1:0:1 Dead
    esx2f1.douglas-informatik.de vmhba1:1:1 Dead
    esx2f1.douglas-informatik.de vmhba1:2:1 Dead

    That was right and we fixed the physical problem so far, but your script told us still the same problem. I can’t find any dead path at the service console.
    Have you any idea?

    Best Marcel

  34. nick says:

    Thank You Alan!

  35. Dan Tracey says:

    @Virtu-Al
    Hi Al – ever so sorry – I should have RTFM – all great now. Thanks again! Dan

  36. Virtu-Al says:

    @Dan Tracey
    The errors are coming from the part that is used to communicate to your vCenter server over WMI, if your current account has access to that servers then you will be fine, if not then all you need to do is put a username in the $SetUsername = “” bit, so if I set it to $SetUsername = “mydomain\me” then next time you run the script it will ask you for a username and password, enter the same username (mydomain\me) and the password.

    The credentils will then be stored in an encrypted file so that every other time you run the script it will have the correct permissions.

    A little complicated I know but it was the easiest way I could find of doing it.

  37. Dan Tracey says:

    Hey Alan – thanks for this mate. The report runs well until it hits Checking VC Services:
    ————-
    14:48 ..Checking Host Alarms
    14:48 ..Checking VM Alarms
    14:48 ..Checking Cluster Configuration Issues
    14:48 ..Checking VC Services
    Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESS
    DENIED))
    At C:\Documents and Settings\dan.tracey\Desktop\VC Diagnostics\vCheck.ps1:280 c
    har:28
    + $Services = get-wmiobject <<<< win32_service -ComputerName $VISRV |
    Where {$_.DisplayName -like "VMware*" }
    14:48 ..Checking VC Error Event Logs
    Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESS
    DENIED))
    At C:\Documents and Settings\dan.tracey\Desktop\VC Diagnostics\vCheck.ps1:937 c
    har:31
    + $ErrLogs = @(Get-WmiObject <<<='” + $Conv
    Date + “‘”) | Where {$_.Message -like “*VMware*”} | Select @{N=”TimeGenerated”;
    E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
    14:48 ..Checking VC Warning Event Logs
    Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESS
    DENIED))
    At C:\Documents and Settings\dan.tracey\Desktop\VC Diagnostics\vCheck.ps1:954 c
    har:32
    + $WarnLogs = @(Get-WmiObject <<<='” + $C
    onvDate + “‘”) | Where {$_.Message -like “*VMware*”} | Select @{N=”TimeGenerate
    d”;E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message )
    14:48 ..Checking vmkernel logs for warnings
    14:49 ..Sending Email
    Exception calling “Send” with “1” argument(s): “Failure sending mail.”
    At C:\Documents and Settings\dan.tracey\Desktop\VC Diagnostics\vCheck.ps1:151 c
    har:14
    + $mailer.send( <<<

    ———
    I’m a bit of a PowerCLI beginner so all help is very much appreciated!

    Dan

  38. Hi Alan,

    Great work on the vCheck script! I added some extra functionality that checks probems that I encountered on my company’s VMware environment:

    # —- check for vms with unknown status —-
    If ($ShowUnknownVMstatus){
    Write-CustomOut “..Checking for VMs with unknown status”
    $vmstatus = @($FullVM | Select Name, @{N=”OverallStatus”;E={$_.overallstatus}} | where {$_.OverallStatus -eq ‘gray’})
    If (($vmstatus | Measure-Object).count -gt 0) {
    $MyReport += Get-CustomHeader “1” “VMs with unknown status : $($vmstatus.count)”
    $MyReport += Get-HTMLTable $vmstatus
    $MyReport += Get-CustomHeaderClose
    }
    }
    # —- check for vms with runtime questions —-
    If ($ShowVMQuestions){
    Write-CustomOut “..Checking for VMs with runtime questions”
    $vmquestion = @($FullVM | Select Name, @{N=”Text”;E={$_.Runtime.Question.Text}} | where {$_.Text -ne $null})
    If (($vmquestion | Measure-Object).count -gt 0) {
    $MyReport += Get-CustomHeader “1” “VMs with runtime questions : $($vmquestion.count)”
    $MyReport += Get-HTMLTable $vmquestion
    $MyReport += Get-CustomHeaderClose
    }
    }
    # —- check for vms with low memory reservation —-
    If ($ShowLowMemLimit){
    Write-CustomOut “..Checking for VMs with memory reservation lower than assigned RAM”
    $vmlowmemlimit = @($VM | Select Name, MemoryMB, @{N=”MemlimitMB”;E={Get-VMResourceConfiguration -VM $_ | %{$_.MemLimitMB}}} | where {$_.MemlimitMB -ne -1 -AND $_.MemlimitMB -lt $_.MemoryMB})
    If (($vmlowmemlimit | Measure-Object).count -gt 0) {
    $MyReport += Get-CustomHeader “1” “VMs with low memory reservation : $($vmlowmemlimit.count)”
    $MyReport += Get-HTMLTable $vmlowmemlimit
    $MyReport += Get-CustomHeaderClose
    }
    }

    I still want to add a routine that does some resource checks. I’ll add them to this post later.

    Kind regards,

    Rudolf Kleijwegt

  39. Chuck says:

    Alan, thanks for the great script. We are using it daily to check our 125 ESX 3.5 hosts. The only issue I have seen so far is that it takes a long time to process the VMs with CPU ready over x% part. Never seems to finish.

    I too was also interested in a cluster memory section that would report memory usage in the event of host failures.

    Is was working on adding this to the script.
    # —- Cluster Capacity —-
    $MyReport += Get-CustomHeader “1” “Cluster Utilization”

    $ClusterInfo = @()
    $clusters = Get-Cluster | Sort Name
    ForEach ($cluster in $clusters)
    {
    Write-Output $cluster
    $ClusterCapacity = “” | Select-Object “ClusterName”, “TotalHosts”, “TotalMemGB”, “UsedMemGB”, “PercMemUsed”, “PercMemUsed1Fail”, “PercMemUsed2Fail”
    $esxhosts = Get-VMHost -Location $cluster

    ForEach ($VMhostView in ($esxhosts | Get-View))
    {
    $TotalMemorySize += $vmhostView.Hardware.MemorySize
    $TotalMemoryUsed += $vmhostView.Summary.QuickStats.OverallMemoryUsage
    }

    $NumHostsInCluster = ($esxhosts | Measure-Object).Count
    $TotalMemorySizeGB = [math]::Round($TotalMemorySize/1GB,$digits)
    $TotalMemoryUsedGB = [math]::Round($TotalMemoryUsed/1024,$digits)
    $TotalMemorySizeGB1Host = [math]::Round($TotalMemorySizeGB / $NumHostsInCluster)
    $TotalMemorySizeGB1Failure = [math]::Round(($NumHostsInCluster-1)*$TotalMemorySizeGB1Host)
    $TotalMemorySizeGB2Failure = [math]::Round(($NumHostsInCluster-2)*$TotalMemorySizeGB1Host)
    $PercentMemoryUsed = [math]::Round(($TotalMemoryUsedGB / $TotalMemorySizeGB) * 100, 0)
    $PercentMemoryUsed1Failure = [math]::Round(($TotalMemoryUsedGB / $TotalMemorySizeGB1Failure) * 100, 0)
    $PercentMemoryUsed2Failure = [math]::Round(($TotalMemoryUsedGB / $TotalMemorySizeGB2Failure) * 100, 0)

    if ($NumHostsInCluster -lt 8){$PercentMemoryUsed2Failure = “n/a”}

    $ClusterCapacity.ClusterName = $cluster
    $ClusterCapacity.TotalHosts = $NumHostsInCluster
    $ClusterCapacity.TotalMemGB = $TotalMemorySizeGB
    $ClusterCapacity.UsedMemGB = $TotalMemoryUsedGB
    $ClusterCapacity.PercMemUsed = $PercentMemoryUsed
    $ClusterCapacity.PercMemUsed1Fail = $PercentMemoryUsed1Failure
    $ClusterCapacity.PercMemUsed2Fail = $PercentMemoryUsed2Failure
    $ClusterInfo+=$ClusterCapacity

    $TotalMemorySize = 0
    $TotalMemoryUsed = 0
    $NumHostsInCluster = 0
    $TotalMemorySizeGB = 0
    $TotalMemoryUsedGB = 0
    $TotalMemorySizeGB1Host = 0
    $TotalMemorySizeGB1Failure = 0
    $TotalMemorySizeGB2Failure = 0
    $PercentMemoryUsed = 0
    $PercentMemoryUsed1Failure = 0
    $PercentMemoryUsed2Failure = 0

    }

    $MyReport += Get-HTMLTable $ClusterInfo
    $MyReport += Get-CustomHeaderClose

    This code probably needs more work, but I am still learning.

    I was looking to have a separate report that would be used for Capacity Planning with sections on the report that would have Cluster Utilization based on Memory, CPU, Storage and VM info.

    Once againg thanks for your great work!

  40. Harold says:

    Alan, I have a feature request :-)

    Can you add a cluster memory section:
    – How much Memory is available in the cluster?
    – Huw much Memory is granted to VMs in this cluster?

    Why? I need to know when I take one host in maintenance, can the rest of the hosts in the cluster handle these vm’s, without memory overcommitment.
    (We have a N+1 hosts policy, no memory overcommitment)

    Thanks,
    Harold

  41. Sudharsan says:

    There are couple of Requests too :)

    1)Is it possible to report the Average utilization of the vSphere Server say for a specific period of time so that we also will know how over / under utilized is the vSphere Server ?

    2 ) Also , is there a way to run this for multiple Virtual Center Servers in the same schedule and generate a single report ?

  42. Virtu-Al says:

    @Thomas Paulsen
    Glad you managed to resolve it, dont worry about the warning to do with the certificate, just so long as it doesnt stop the script from working.

  43. Virtu-Al says:

    @Switchgott
    I take it the script runs if you run it manually from PS or from an editor ?

  44. Virtu-Al says:

    @Harold
    Glad you managed to resolve it.

  45. Switchgott says:

    Hi, no, not realy!

  46. Thomas Paulsen says:

    @Thomas Paulsen
    Problem has been solved by installing VI Toolkit 1.5

    But the CN Name certificate problem still exists, although it does not prevent the script from doing it’s job.

    More detail on the “error” warning, now with VI Toolkit 1.5:

    WARNING: There were one or more problems with the server certificate:

    * The X509 chain could not be built up to the root certificate.

    * The certificate’s CN name does not match the passed value.

  47. Harold says:

    Virtu-Al :
    @Harold
    Do your clusters have HA enabled ?

    Thanks for the quick response.
    This was my mistake,…. launched the script from VI toolkit 1.5.
    RetrieveDasAdvancedRuntimeInfo is a vSphere PowerCLI 4.0 method.
    I have upgraded and now it runs fine!

  48. Thomas Paulsen says:

    @Thomas Paulsen
    Updated Powershell to v2, now I have a more detailed error message:

    PS C:\install\VSphere Addons> .\Status.ps1 itgvc001
    11:33 Connecting to VI Server
    There were one or more problems with the server certificate:

    * A certification chain processed correctly, but terminated in a root certificat
    e which isn’t trusted by the trust provider.

    * The certificate’s CN name does not match the passed value.

    Connect-VIServer : not connected
    At C:\install\VSphere Addons\Status.ps1:483 char:29
    + $VIServer = Connect-VIServer <<<< $VISRV
    + CategoryInfo : NotSpecified: (:) [Connect-VIServer], ViServerCo
    nnectionException
    + FullyQualifiedErrorId : VMware.VimAutomation.Types.ViServerConnectionExc
    eption,VMware.VimAutomation.Commands.ConnectVIServer

    Connect-VIServer : not connected
    At C:\install\VSphere Addons\Status.ps1:494 char:30
    + $VIServer = Connect-VIServer <<<< $VISRV
    + CategoryInfo : NotSpecified: (:) [Connect-VIServer], ViServerCo
    nnectionException
    + FullyQualifiedErrorId : VMware.VimAutomation.Types.ViServerConnectionExc
    eption,VMware.VimAutomation.Commands.ConnectVIServer

  49. Thomas Paulsen says:

    I’m having problems, connecting to the VI Server, it gives me a certificate warning and I can’t connect.
    Does anyone have an idea, on how to fix this?

    PS C:\install\VSphere Addons> .\Status.ps1 itgvc001
    11:15 Connecting to VI Server
    There were one or more problems with the server certificate:

    * A certification chain processed correctly, but terminated in a root certificat
    e which isn’t trusted by the trust provider.

    * The certificate’s CN name does not match the passed value.

    Connect-VIServer : not connected
    At C:\install\VSphere Addons\Status.ps1:483 char:29
    + $VIServer = Connect-VIServer <<<< $VISRV
    Connect-VIServer : not connected
    At C:\install\VSphere Addons\Status.ps1:494 char:30
    + $VIServer = Connect-VIServer <<<< $VISRV

  50. Virtu-Al says:

    @Vincent
    Its a good idea, I was thinking about adding a switch to the script for datacenter and cluster only reports

  51. Virtu-Al says:

    @Switchgott
    Ok, so you got it working ??

  52. Switchgott says:

    Thanks for your answer!If i post in dos box, looks loke this:

    C:\WINDOWS>C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleF
    ile “C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\vim.psc1? ” & “C:\S
    cripts\VMware\DailyReport.ps1 MYVISERVER”

    This comments are the problem: ″ ” & “C

  53. Vincent says:

    Great script, just saved me from a nasty situation that was prone to happen.

    While i’m here, I would like to submit a feature request.
    1) The posibility to only include some (one or more) clusters within the VI configuration and thus exclude all others. We have multiple clusters of which other departments are in control of. I don’t want to know there problems and they don’t want to know mine.

    2) In the Snapshot inventory (date > snapshop creation date) can you add a column that specifies on what cluster the guest is running?

  54. Virtu-Al says:

    @Switchgott
    Mine looks like this:

    C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile “C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\vim.psc1″ ” & “C:\Scripts\VMware\DailyReport.ps1 MYVISERVER”

    I paste it into a dos window to make sure it works before adding to a scheduled task.

  55. Virtu-Al says:

    @Harold
    Do your clusters have HA enabled ?

  56. Virtu-Al says:

    @Sudharsan
    Thanks, I worked hard last week and this week to get them out.

  57. Virtu-Al says:

    @DJLO
    Thanks man, that is so much appreciated. Thanks very much.

  58. Virtu-Al says:

    @ZOMAN
    At the moment I only pull the lines out which have the word ‘WARNING’ in it, is there other string matches you think may be usefull ?

  59. Virtu-Al says:

    @Jerry C
    Now thats the kind of comments I like, I love the fact that this script is showing people issues they never had or never even thought of looking for. Thanks for the comment.

  60. Switchgott says:

    Hi,
    please can someone tell me how to run this script?
    My Batfile looks like:
    C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile “C:\Programme\VMware\Infrastructure\vSphere PowerCLI\vim.psc1″&”C:\test\vCheckV3.psc1 vcenter”

    I changed my mailserver and other parameters, but i don´t reviece a email yet.
    Idea?
    Big thanks

  61. Harold says:

    Super Script! Helps us a lot to keep track of the Virtual Environment.

    Only one thing, when run against a vCenter4/esx4i environment I get this error for every Cluster it finds:
    Method invocation failed because [VMware.Vim.ClusterComputeResource] doesn’t contain a method named ‘RetrieveDasAdvancedRuntimeInfo’.
    At D:\scripts\DailyReport\DailyReport.ps1:701 char:61
    + $SlotDetails = $Cluster.RetrieveDasAdvancedRuntimeInfo( <<<< )

    Any suggestions?

  62. Sudharsan says:

    Alan – WOW Again !! You continue to amaze me .. Within a week from release of the consolidated POWERPACK of yours.

    Thanks again !!

    Virtually anything is possible with you guys arnd !!

  63. Mark says:

    Works like a charm. Nice Job!

  64. DJLO says:

    Alan

    Wow yet again, just when i thought v2 was the king script, along comes v3 with all sorts of new goodies.

    Thanks for putting up a donation page, i felt compelled to give something back for all your hard efforts

    Cheers
    Paolo aka DJLO

  65. ZOMAN says:

    “vmkernel warning messages ov the last x days” I see this listed but not on many my reports although I have two servers that have vmkwarning logs that get about 1-2gb every few days with scsi errors and such can you explain as I am missing something not enough fuel (coffee) yet this afternoon lol

  66. ZOMAN says:

    Excellent Report once again …..I was thinking about maybe if you could add a section that states the size of your vmkwarnings and or vmkernel log which would kind of lead to you looking at that host as something must be wrong if that file is any type of size in terms of having data written to it correct?

    none the less Thank you once again for this fabulous reporting tool

  67. Jerry C says:

    Outstanding report, Al! We’ve been using it in our environment and has allowed us to be more proactive in fixing items before they become huge problems. By the way, Scott Herold was just at our Portland, OR VMWare Technical Conference and he gave you some love in his presentation on TheVesi. Thanks again for the script!

  68. Chris says:

    oh mines got lots of issues 😀

  69. Virtu-Al says:

    @Duncan
    Will do, just wanted to get the code out as I have been delaying it for a number of days so far, it will take a while to put one together that has all these issues for people to see what each one looks like :)

  70. Chris says:

    Duncan I’d forward one I did earlier but I’m embrassed as to the number of things its highlighted I need to get sorted out :)

  71. Duncan says:

    might want to add an example report! Would be nice to see what it can do…

  72. Chris says:

    It does keep running. I seem to remeber having a few little bugs with the previous version – nb its running on a medium sized environment ( 21 hosts / 300 Vm’s ) – not braved it on the big one yet :)

  73. Virtu-Al says:

    @Chris
    Does it crash out or keep running ? Strange This was in the previosu version also, did you have any issues with the previous version ?

  74. Chris says:

    hi Al , loving the script but it seems to be gettin upset calculating the cpu %ready stuff.

    Note the script had been running for about 20 minutes at this point , is is posisble its hitting a timeout.

    15:24 ..Checking VM CPU %RDY
    Get-Stat : 04/11/2009 15:24:26 Get-Stat 1FE8AA92-9E03-450D-B247-A95E26B77
    E89 The session is not authenticated.
    At C:\temp\vcheckv3.ps1:827 char:54
    + $myObj.PercReady = [Math]::Round((($v | Get-Stat <<<< -S
    tat Cpu.Ready.Summation -RealTime | Where {$_.Instance -eq $cpunum} | Measure-O
    bject -Property Value -Average).Average)/200,1)

  75. Tom says:

    Change the name?? Daily Issue Checking?? LOL
    Just every time you blog about vCheck be clear that it’s for issue checking??

  76. Rob P says:

    Juicy… Love the new script. Can’t wait for v4.

  77. Chris says:

    Awesome as usual.

  1. November 4, 2009

    […] over to his site now to download […]

  2. November 5, 2009

    […] to ask around in the community what his report was lacking and incorporated all these tips in Version 3 of vCheck(previously known as the Daily Report). Again, if you feel there is anything missing […]

  3. November 10, 2009

    […] La v3 de vCheck (aka Daily Report) vient de sortir. Si vous ne connaissiez pas cet outil, nous tenons à vous prévenir qu’il est hautement addictif ! Une fois testé, vous ne pourrez absolument plus vous en passer. […]

  4. February 19, 2010

    […] yet to try these scripts out but if these do what they say they can do and are anything like his vcheck tool then I can’t wait to get them to make my daily job […]

  5. March 24, 2010

    […] is part of the vCheck daily report ,one I have spoken of before which is also created by Alan. The vCheck tool is a brilliant reporter […]

  6. October 10, 2010

    […] free and simple way to do this is to run the vCheck PowerShell script created by Alan Renouf (http://www.virtu-al.net/2009/11/04/vcheck-daily-report-v3/). This will give you a great view on these and many other potential issues within your […]

Leave a Reply

%d bloggers like this: