Start a new topic

Pie chart computer health

 I have this pie chart for showing the # of computers per health state. It would be nice to be able to set the colors. Is that possible?


This is my script:

 

$result = @()


$computers        = Get-ScomClass -DisplayName "Computer" | Get-SCOMClassInstance 

$result += [PSCustomObject]@{
    Title = "Critical"
    Value = ($computers | where {($_.IsAvailable -eq $true) -and ($_.HealthState -eq "Error")}).count
}
$result += [PSCustomObject]@{
    Title = "Warning"
    Value = ($computers | where {($_.IsAvailable -eq $true) -and ($_.HealthState -eq "Warning")}).count
}
$result += [PSCustomObject]@{
    Title = "Healthy"
    Value = ($computers | where {($_.IsAvailable -eq $true) -and($_.HealthState -eq "Success")}).Count
}
$result += [PSCustomObject]@{
    Title = "Maintenance"
    Value = ($computers | where {$_.InMaintenanceMode -eq $true}).Count
}
$result += [PSCustomObject]@{
    Title = "Grey"
    Value =  ($computers | where {($_.IsAvailable -eq $false) -or(($_.HealthState -eq "Uninitialized")-and($_.InMaintenanceMode -eq $false))}).Count
}

$result

 


$result = @()


$computers        = Get-ScomClass -DisplayName "Computer" | Get-SCOMClassInstance 

$result += [PSCustomObject]@{
    Title = "Critical"
    Value = ($computers | where {($_.IsAvailable -eq $true) -and ($_.HealthState -eq "Error")}).count
}
$result += [PSCustomObject]@{
    Title = "Warning"
    Value = ($computers | where {($_.IsAvailable -eq $true) -and ($_.HealthState -eq "Warning")}).count
}
$result += [PSCustomObject]@{
    Title = "Healthy"
    Value = ($computers | where {($_.IsAvailable -eq $true) -and($_.HealthState -eq "Success")}).Count
}
$result += [PSCustomObject]@{
    Title = "Maintenance"
    Value = ($computers | where {$_.InMaintenanceMode -eq $true}).Count
}
$result += [PSCustomObject]@{
    Title = "Grey"
    Value =  ($computers | where {($_.IsAvailable -eq $false) -or(($_.HealthState -eq "Uninitialized")-and($_.InMaintenanceMode -eq $false))}).Count
}

$result

 




This is something we want to do. It makes complete sense when you are using something like health states to force them in to Red/Yellow/Green/Gray colors. However at this time that is not possible. 


We do have plans for a Theming in an upcoming release of Live Maps. During that time frame I believe we will expose the tools necessary to change the colors or various parts of the Portal. 


Chris Malay

I reordered the selection so that grey is indeed grey, critical is purple, healthy is green. It's a little better ;-)


Login or Signup to post a comment