PowerCLI

 View Only
Expand all | Collapse all

Does vCheck report monitor Microsoft Hyper-V

  • 1.  Does vCheck report monitor Microsoft Hyper-V

    Posted Jan 27, 2020 04:43 AM

    Hi All,

    Does the vCheck health report  monitor Microsoft Hyper-V also ? If no, any other tools which is similar to vCheck for Hyper-V ?

    Thanks

    V



  • 2.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Jan 27, 2020 06:41 AM

    There is a vCheck for SCVMM. You can download it from: GitHub - vCheckReport/vCheck-SCVMM: vCheck for SCVMM



  • 3.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Jan 27, 2020 07:14 AM

    The vCheck for SCVMM is rather old and doesn't have support for recent Hyper-V features.

    As noted in this issue "... pretty much abandoned and would require an active maintainer".
    There are no immediate updates planned for this vCehck version.

    There are a number of monitoring tools available for Hyper-V that do support the recent versions.

    See for example 11 Best Hyper-V Monitoring Tools & Software for 2020 for an overview of what is available.



  • 4.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 12:08 PM

    LucD,

    Since my environment is legacy so i though to give a try vCheck, but it throwing below error. Any idea why. Also, do i need to run from  Hyper-V host only where SCVMM installed ?

    PS D:\vCheck-SCVMM-master> .\vCheck.ps1

    1:02:44 PM Collecting VM Host Objects

    1:02:44 PM Collecting VM Objects

    1:02:44 PM Collecting VM Host Cluster Objects

    1:02:44 PM ..finished calculating SC VMM Connection Plugin by Jan Egil Ring v1.0

    1:02:44 PM ..finished calculating General information by Jan Egil Ring v1.0

    1:02:44 PM ..finished calculating System Center Virtual Machine Manager - Basic Host Information by Jan Egil Ring

    1:02:44 PM ..finished calculating VMs with old snapshots by Jan Egil Ring v1.0

    1:02:44 PM ..finished calculating New VMs by Jan Egil Ring v1.0

    1:02:44 PM ..finished calculating VM Operating System Statistics by Jan Egil Ring v1.0

    1:02:44 PM ..finished calculating VMs with mounted ISO by Jan Egil Ring v1.0

    1:02:44 PM ..finished calculating Hyper-V emulated VM NIC Adapters by Jan Egil Ring v1.0

    1:02:44 PM ..finished calculating VMs with static MAC address by Jan Egil Ring v1.0

    1:02:44 PM ..finished calculating Hyper-V Cluster Shared Volumes by Jan Egil Ring v1.0

    1:02:44 PM ..finished calculating Dynamically Expanding Disks by Jan Egil Ring v1.0

    1:02:45 PM ..finished calculating Dynamically Expanding Disks Consolidation Forecast by Jan Egil Ring v1.0

    1:02:45 PM ..finished calculating Hyper-V Integration Components Version by Jan Egil Ring v1.0

    1:02:45 PM ..finished calculating Hyper-V 2008 R2 SP1 Capacity Report by Jan Egil Ring v1.0

    Get-vCheckPlugin : System.Net.WebException: Unable to connect to the remote server --->

    System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it

    104.31.70.29:80

       at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)

       at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket,

    IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

       --- End of inner exception stack trace ---

       at System.Net.WebClient.OpenRead(Uri address)

       at CallSite.Target(Closure , CallSite , Object , String )

    At D:\vCheck-SCVMM-master\Plugins\Plugins Not up to date or installed.ps1:12 char:18

    +     $NotInstalled = Get-vCheckPlugin -NotInstalled | Where { $_.Categ ...

    +                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

        + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-VCheckPlugin

    Thanks

    V



  • 5.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 12:26 PM

    That is what I meant when I stated earlier that this version is not maintained anymore.
    The vCheck script tests if the plugins are up to date.

    The git repo still contains the line (vCeckUtils.ps1 line 115)

    $response = $webClient.openread("http://www.virtu-al.net/vcheck/plugins/plugins.xml")

    while that should probably be

    $response = $webClient.openread("https://vcheck.report/plugins.xml")

    You could try updating that line, but I haven't tested it.



  • 6.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 12:47 PM

    Thank you, LucD. Result is same even after chancing the line#115. I dont want to waste your time, will see to explore any other scripts for monitoring or tools, but there is no free tools (Only Trial) which is not allowed in the environment.

    Thanks

    V



  • 7.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 01:28 PM

    LucD,

    Can we add send mail as report for below script. I did check its working..

    also, i want it should not prompt me every time SCVMM server name.

    PS> ./scvmm.ps1

    #>

    # Import modules

    Import-Module -Name "Hyper-v"

    Import-Module -Name "VirtualMachineManager"

    #Variables

    $Date = Get-Date

    $Datefile = ( get-date ).ToString('yyyy-MM-dd-hhmmss')

    $File = New-Item -type file "D:\Temp\Healtcheck_$datefile.html"

    #Connect to the SCVMM server

    Clear

    $VMMName = Read-Host "Enter System Center Virtual Machine Server Name to check"

    Write-Host "VMM name is $VMMName" -ForeGround Red

    Get-VMMServer -ComputerName $VMMName

    #HTML

    # Add Text to the HTML file

    Function Create-HTMLTable

        {

        param([array]$Array)

        $arrHTML = $Array | ConvertTo-Html

        $arrHTML[-1] = $arrHTML[-1].ToString().Replace('</body></html>',"")

        Return $arrHTML[5..2000]

        }

    $output = @()

    $output += '<html><head></head><body>'

    $output +=

    '<style>table{border-style:solid;border-width:1px;font-size:8pt;background-color:#ccc;width:100%;}th{text-align:left;}td{background-color:#fff;width:20%;border-style:so

    lid;border-width:1px;}body{font-family:verdana;font-size:12pt;}h1{font-size:12pt;}h2{font-size:10pt;}</style>'

    $output += '<h1>Hyper-V health check</h1>'

    $output += '<h1>Versie 1.0</h1>'

    $output += '<h2>Date and time</h2>',$date

    # Hosts

    $HVHosts = Get-VMHost | Select HostCluster,Name,PhysicalCPUCount,CoresPerCPU,ProcessorManufacturer,CPUSpeed,CPUModel,@{N="Memory(GB)";E={[math]::Round((($_.TotalMemory)/1GB),3)}},OperatingSystem,EnableLiveMigration,VMHostGroup

    $output += '<p>'

    $output += '<h1>Hosts</h1>'

    $output += '<p>'

    $output += Create-HTMLTable $HVHosts

    $output += '</p>'

    # VM

    $VMs = Get-VM | Select Name,ComputerName,HostName,CPUCount,CpuType,MemoryAssignedMB,DynamicMemoryEnabled,OperatingSystem,HasVMAdditions,VMAddition,VirtualMachineState,Status,ReplicationStatus,Location

    $output += '<p>'

    $output += '<h1>VMs</h1>'

    $output += '<p>'

    $output += Create-HTMLTable $VMs

    $output += '</p>'

    # Snapshots

    $VMSnaps = Get-VM | Get-VMCheckpoint | Select VM,Name,Description,AddedTime,ModifiedTime

    $output += '<p>'

    $output += '<h1>Snapshots</h1>'

    $output += '<p>'

    $output += Create-HTMLTable $VMSnaps

    $output += '</p>'

    # End

    $output += '</body></html>'   

    $output | Out-File $file -Force

    # Open the HTML file



  • 8.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 01:41 PM

    You can configure the mail related variables in GlobalVariables.ps1

    Especially the $SendMail variable should be set to $true.


    You can try changing

    $VMMName = Read-Host "Enter System Center Virtual Machine Server Name to check"

    with

    $VMMName = 'MySCVM'



  • 9.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 01:55 PM

    LucD,

    My  apologies, above script is different from vcheck,  If i use the below recommendation. Do i need to call $GlobalVariable in the new script  to send the mail ?

    $VMMName = Read-Host "Enter System Center Virtual Machine Server Name to check"

    with

    $VMMName = 'MySCVM'

    Thanks

    V



  • 10.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 02:04 PM

    Oops.

    It seems you forgot the Body

    $sMail = @{

        From = 'me@domain'

        To = 'you@domsain'

        Subject = 'Cluster report'

        SmtpServer = smtp@domain

        BodyAsHtml = $true

        Body = $output | Out-String

    }

    Send-MailMessage @sMail



  • 11.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 02:31 PM

    LucD.

    Do i need to put smtp address in SmtpServer = 'smtp@domain'     ?    it shows below error and ask for SCVMM server name. Cant we avoid this ? I want i dont have to give SCVMM server becuase i wan to run from task scheduler. Can we declare in the script the SCVMM server name ?

    Thanks

    V



  • 12.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 02:40 PM

    Those are 2 different errors.

    The Hyper-V module apparently is not installed.

    For avoiding the prompt for the server, use the lines I gave earlier.

    Replace the Read-Host by a simple assignment



  • 13.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 02:42 PM

    No, SmtpServer should have the FQDN of the SMTP server.

    SmtpServer = smtp.domain



  • 14.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 04:43 PM

    LucD,

    I did receive the report once after smtp but still prompting for SCVMM name and now the report also not generating. I got the success once before makingany changes in smtp (as said by you)

    Enter System Center Virtual Machine Server Name to check: H000MV01

    VMM name is H000MV01Get-VMMServer : The term 'Get-VMMServer' is not recognized as the name of a cmdlet, function, script file, or operable

    program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

    At D:\scvmmhc.ps1:27 char:1

    + Get-VMMServer -ComputerName $VMMName

    + ~~~~~~~~~~~~~

        + CategoryInfo          : ObjectNotFound: (Get-VMMServer:String) [], CommandNotFoundException

        + FullyQualifiedErrorId : CommandNotFoundException

    Get-VMHost : The term 'Get-VMHost' is not recognized as the name of a cmdlet, function, script file, or operable

    program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

    At D:\scvmmhc.ps1:50 char:12

    + $HVHosts = Get-VMHost | Select HostCluster,Name,PhysicalCPUCount,Core ...

    +            ~~~~~~~~~~

        + CategoryInfo          : ObjectNotFound: (Get-VMHost:String) [], CommandNotFoundException

        + FullyQualifiedErrorId : CommandNotFoundException

    Get-VM : The term 'Get-VM' is not recognized as the name of a cmdlet, function, script file, or operable program.

    Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

    At D:\scvmmhc.ps1:58 char:8

    + $VMs = Get-VM | Select Name,ComputerName,HostName,CPUCount,CpuType,Me ...

    +        ~~~~~~

        + CategoryInfo          : ObjectNotFound: (Get-VM:String) [], CommandNotFoundException

        + FullyQualifiedErrorId : CommandNotFoundException

    Get-VM : The term 'Get-VM' is not recognized as the name of a cmdlet, function, script file, or operable program.

    Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

    At D:\scvmmhc.ps1:66 char:12

    + $VMSnaps = Get-VM | Get-VMCheckpoint | Select VM,Name,Description,Add ...

    +            ~~~~~~

        + CategoryInfo          : ObjectNotFound: (Get-VM:String) [], CommandNotFoundException

        + FullyQualifiedErrorId : CommandNotFoundException

    Thanks

    V



  • 15.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 05:19 PM

    You seem to have an issue with the Get-SCVMMServer cmdlet.

    That belongs to the VirtualMachineManager module.

    Is that module installed?

    Then you have error related to PowerCLI cmdlets.
    Are the PowerCLI modules installed for the user under which you run the script?

    Do a

    Get-Module -ListAvailable

    I don't think a change to the SmtpServer parameter has caused these errors.

    Perhaps attach your current version of the script again?



  • 16.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 05:47 PM

    PFA  out for module installed and script.

    ou seem to have an issue with the Get-SCVMMServer cmdlet.

    That belongs to the VirtualMachineManager module.

    Is that module installed?  Yes, installed it just now

    Then you have error related to PowerCLI cmdlets.
    Are the PowerCLI modules installed for the user under which you run the script?

    Do a

    Get-Module -ListAvailable -  see attached output

    Also, I m keep getting smtp server not recognized if remove single quotes.



  • 17.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 05:58 PM

    Then put quotes around the SMTP server FQDN.

    I'm not really sure what you trying to do here.

    Are you generating a report for a Hyper-V environment?

    Then why do you use Get-VMHost, which is a PowerCLI cmdlet?

    Did you write that script?

    Or did you downloaded it from somewhere?



  • 18.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 06:08 PM

    LucD,

    Are you generating a report for a Hyper-V environment?  - Yes it's Hyper-V

    Then why do you use Get-VMHost, which is a PowerCLI cmdlet? I used the same command in previous mail thread and it worked, not sure where it broke.

    Did you write that script? - No

    Or did you downloaded it from somewhere?  I got it from my friend and its worked for him

    Thanks

    V



  • 19.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 06:18 PM

    Ok, when you place the SmtpServer value between quotes, what is the output from the script?

    Do you still get the Get-VMMServer cmdlet error?

    Even if you add

    Import-Module -Name VirtualMachineManager -Verbose

    at the start of the script?
    Same for the Hyper-V module if you still get errors for Get-VM and Get-VMHost



  • 20.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 06:33 PM

    ore i did changes in smtp, i got the success from same script. After i installed the Hyper-v module also, but still generating blank report.

    Ok, when you place the SmtpServer value between quotes, what is the output from the script?

    Do you still get the Get-VMMServer cmdlet error?   - Yes

    Even if you add

    Import-Module -Name VirtualMachineManager -Verbose   ( see the screenshot below)

    at the start of the script?

    Same for the Hyper-V module if you still get errors for Get-VM and Get-VMHost

    output :-

    Thanks

    V



  • 21.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 06:48 PM

    Ok, the module doesn't load.

    That could be because the VirtualMachineManager module is not located in a folder that is in $env:PSModulePath

    Check if the folder D:\Program Files\Microsoft System Center 2016\Virtual Machine Manager\bin\psModules is in $env:PSModulePath

    The later errors for Get-VMHost and Get-VM most probably are all a result of the Get-VMMServer cmdlet failing.

    Add the path of the VMM module to $env:PSModulePath or copy the VMM module to a folder that is present in $env:PSModulePath



  • 22.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 07:02 PM

    Ok, i did check the $env:PSModulePath. How to add path to $env:PSModulePath ? You mean registry edit ?

    Also, strange thing i noticed when i am running power shell without admin, i'm getting report with error on  console.

    Thanks

    V



  • 23.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 07:06 PM

    See Modifying the PSModulePath Installation Path

    The Hyper-V cmdlets are using WMI, and that may require specific authorization (or to run As Administrator).

    See Why Your Hyper-V PowerShell Commands Don’t Work (and how to fix them)



  • 24.  RE: Does vCheck report monitor Microsoft Hyper-V

    Posted Feb 04, 2020 01:39 PM

    Ok i did try to send the report througb mail, but its blank report

    $sMail = @{

       From = 'me@domain'

       To = 'you@domsain'

       Subject = 'Cluster report'

     

       SmtpServer = smtp@domain

       BodyAsHtml = $true

    }

    Send-MailMessage @sMail