Skip to content

Commit

Permalink
fix: free pool health
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryJBlake authored Dec 2, 2022
2 parents 5211975 + b897e43 commit 32cb99f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions VMware.CloudFoundation.Reporting.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -5592,7 +5592,7 @@ Function Request-SddcManagerFreePool {
.DESCRIPTION
The Request-SddcManagerFreePool cmdlet returns status of the ESXi hosts in the free pool. The cmdlet connects
to SDDC Manager using the -server, -user, and -password values:
- Validates that network connectivity and authencitation is possible o the SDDC Manager instance
- Validates that network connectivity and authentication is possible to the SDDC Manager instance
- Gathers the details for the ESXi hosts in the free pool

.EXAMPLE
Expand Down Expand Up @@ -5654,9 +5654,11 @@ Function Request-SddcManagerFreePool {
foreach ($properties in $licenseManager.Evaluation.Properties) {
if ($properties.key -eq "expirationDate") {
$expirationDate = $properties.value
$expiryDate = [math]::Ceiling((([DateTime]$expirationDate) - (Get-Date)).TotalDays)
} elseif ($properties.key -eq "diagnostic") {
$expiryDate = 0
}
}
$expiryDate = [math]::Ceiling((([DateTime]$expirationDate) - (Get-Date)).TotalDays)
if ($expiryDate -gt "0") {
$alert = "GREEN"
$message = "No expired license running on the host."
Expand All @@ -5665,7 +5667,7 @@ Function Request-SddcManagerFreePool {
$message = "License installed on the ESXi host has expired."
}
$elementObject = New-Object -TypeName psobject
$elementObject | Add-Member -NotePropertyName 'Component' -NotePropertyValue 'Evaluation License'
$elementObject | Add-Member -NotePropertyName 'Component' -NotePropertyValue 'ESXi License'
$elementObject | Add-Member -NotePropertyName 'ESXi FQDN' -NotePropertyValue $esxiHost.fqdn
$elementObject | Add-Member -NotePropertyName 'Alert' -NotePropertyValue $alert
$elementObject | Add-Member -NotePropertyName 'Message' -NotePropertyValue $message
Expand Down

0 comments on commit 32cb99f

Please sign in to comment.