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
There is a vCheck for SCVMM. You can download it from: GitHub - vCheckReport/vCheck-SCVMM: vCheck for SCVMM
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.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
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
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)
while that should probably be
You could try updating that line, but I haven't tested it.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
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
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
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
You can configure the mail related variables in GlobalVariables.ps1
Especially the $SendMail variable should be set to $true.
You can try changing
with
$VMMName = 'MySCVM'
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
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
Oops.
It seems you forgot the Body
From = 'me@domain'
To = 'you@domsain'
Subject = 'Cluster report'
SmtpServer = smtp@domain
BodyAsHtml = $true
Body = $output | Out-String
}
Send-MailMessage @sMail
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
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
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
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
No, SmtpServer should have the FQDN of the SMTP server.
SmtpServer = smtp.domain
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
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
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?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
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.
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?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
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
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
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference