SCOM 2016 dashboard view to display resource utilization of all servers

Nizwan Sultan P N 21 Reputation points
2021-05-19T06:51:42.027+00:00

Hi Guys,

I have been trying for weeks to create a SCOM custom dashboard view to display current CPU%, RAM%, Network%, C drive %, D drive % in one single view. SCOM has the limitation to display only the "Top 20" resource utilization but in my case I have more than 60+ server and all of them needs to be displayed. I was suggested that this could be possible using a PowerShell dashboard and I have done too many research to find a script which could help me based on my requirement but unfortunately could not find any blogs or post which is relevant to my need. Could someone please help me out with my request?

Operations Manager
Operations Manager
A family of System Center products that provide infrastructure monitoring, help ensure the predictable performance and availability of vital applications, and offer comprehensive monitoring for datacenters and cloud, both private and public.
1,505 questions
{count} votes

Accepted answer
  1. AlexZhu-MSFT 5,956 Reputation points Microsoft Vendor
    2021-07-06T05:05:27.97+00:00

    Hi,

    Thank you for asking this. For a quick lab test, I've created a dashboard view with two grid columns and add the PowerShell Grid Widget for one of them. And the powershell is something like this.

    $class = Get-SCOMClass -Name Microsoft.Windows.Computer  
    $computers = Get-SCOMClassInstance -Class $class  
    $i=1  
    foreach ($computer in $computers)  
    {  
        $cpu_usage = (Get-WmiObject -ComputerName $computer -Class win32_processor -ErrorAction silentlycontinue | Measure-Object -Property LoadPercentage -Average | Select-Object Average).Average.ToString()+"%"  
        $dataObject=$ScriptContext.CreateFromObject($computer,"Id=Id,HealthState=HealthState,DisplayName=DisplayName",$null)  
        $dataObject["Index"]=$i  
        $dataObject["CPU_Usage"]=$cpu_usage  
        $ScriptContext.ReturnCollection.Add($dataObject)  
        $i++  
    }  
      
    

    Note: Get-WmiObject need remote administration permission on target computer. We can set -ErrorAction Stop to see if any errors. If 0x800706BA error appears, check this article:
    https://www.vspbreda.nl/nl/server-os/server-2008/error-get-wmiobject-the-rpc-server-is-unavailable-exception-from-hresult-0x800706ba/
    Note: the above link is not from MS, just for your reference.

    After that, the output is like this:

    111986-scom-pwershell-dashboard-01.png

    For more information about dashboard scrip widget, we may refer to:
    https://social.technet.microsoft.com/wiki/contents/articles/24595.operations-manager-dashboard-script-widgets.aspx

    Alex
    If the response is helpful, please click "Accept Answer" and upvote it.


5 additional answers

Sort by: Most helpful
  1. CyrAz 5,181 Reputation points
    2021-06-07T11:22:51.42+00:00

    Indeed, there are so many ways to do this...
    As long as the data is collected by SCOM and therefore stored in the Datawarehouse, you can display it with whatever tool you like.
    Native perf report, powershell, raw SQL query, PowerBI, Grafana or as suggested by @sameermhaisekar : SquaredUp (probably the best option).

    1 person found this answer helpful.
    0 comments No comments

  2. AlexZhu-MSFT 5,956 Reputation points Microsoft Vendor
    2021-07-09T01:44:19.547+00:00

    Hi Zid-3479,

    It seems the script contains minor spelling error that prevents the result. I've changed the script slightly and you may have a try in your environment.

    $class = Get-SCOMClass -Name Microsoft.Windows.Computer  
    $computers = Get-SCOMClassInstance -Class $class  
    $i=1  
    foreach ($computer in $computers)  
    {  
        $cpu_usage = (Get-WmiObject -ComputerName $computer -Class win32_processor | Measure-Object -Property LoadPercentage -Average | Select-Object Average).Average.ToString()  
        $mem_usage = Get-WmiObject win32_operatingsystem -ComputerName $computer | Foreach {"{0:N2}" -f ((($_.TotalVisibleMemorySize - $_.FreePhysicalMemory)*100)/ $_.TotalVisibleMemorySize)}  
        $disk_usage_c = Get-WmiObject Win32_Volume -ComputerName $computer -Filter "DriveLetter = 'C:'" | Foreach {"{0:N2}" -f (($_.FreeSpace / $_.Capacity)*100)}  
        $disk_usage_d = Get-WmiObject Win32_Volume -ComputerName $computer -Filter "DriveLetter = 'D:'" | Foreach {"{0:N2}" -f (($_.FreeSpace / $_.Capacity)*100)}  
        $dataObject=$ScriptContext.CreateFromObject($computer,"Id=Id,HealthState=HealthState,DisplayName=DisplayName",$null)  
        $dataObject["Index"]=$i  
        $dataObject["CPU%"]=$cpu_usage  
        $dataObject["Memory%"]=$mem_usage  
        $dataObject["C:Drive"]=$disk_usage_c  
        $dataObject["D:Drive"]=$disk_usage_d  
        $ScriptContext.ReturnCollection.Add($dataObject)  
        $i++  
    }  
      
    

    screenshot for your reference:

    113144-scom-pwershell-dashboard-02.png

    Alex
    If the response is helpful, please click "Accept Answer" and upvote it.

    1 person found this answer helpful.

  3. AlexZhu-MSFT 5,956 Reputation points Microsoft Vendor
    2021-07-15T07:57:27.83+00:00

    Hi,

    Sorry for missing your reply. For the time-out issue, it seems we can add some debugging to find out which server(s) spend more times and take actions accordingly. For example, some servers may be shutdown.

    For the remote console issue, it seems there is no perfect way to solve this and we may fire up a ticket in the uservoice to see if product team can work on this. Currently, we may consider that we RDP to the management server.

    General Operations Manager Feedback
    https://systemcenterom.uservoice.com/forums/293064-general-operations-manager-feedback

    Also, I noticed that this thread is about two months ago. Commonly, new posts are more likely to get noticed. If possible, you may create a new thread to see if anyone who ever experienced the similar situation can help.

    For debugging, we can run the following script on the management server directly

    $time_begin_0 = get-date  
    $class = Get-SCOMClass -Name Microsoft.Windows.Computer  
    $computers = Get-SCOMClassInstance -Class $class  
    $i=1  
    foreach ($computer in $computers)  
    {  
        $time_begin = get-date  
        $cpu_usage = (Get-WmiObject -ComputerName $computer -Class win32_processor | Measure-Object -Property LoadPercentage -Average | Select-Object Average).Average.ToString()  
        $mem_usage = Get-WmiObject win32_operatingsystem -ComputerName $computer | Foreach {"{0:N2}" -f ((($_.TotalVisibleMemorySize - $_.FreePhysicalMemory)*100)/ $_.TotalVisibleMemorySize)}  
        $disk_usage_c = Get-WmiObject Win32_Volume -ComputerName $computer -Filter "DriveLetter = 'C:'" | Foreach {"{0:N2}" -f (($_.FreeSpace / $_.Capacity)*100)}  
        $disk_usage_d = Get-WmiObject Win32_Volume -ComputerName $computer -Filter "DriveLetter = 'D:'" | Foreach {"{0:N2}" -f (($_.FreeSpace / $_.Capacity)*100)}  
        $i++  
        $time_end = get-date  
        ($time_end - $time_begin).totalmilliseconds.tostring() + " - " + $computer.name  
    }  
    $time_end_0 = get-date  
    ($time_end_0 - $time_begin_0).totalmilliseconds.tostring() + " - total time elapsed"   
      
      
    

    And here's the sample output in the lab.

    114929-scom-pwershell-dashboard-03.png

    Alex
    If the response is helpful, please click "Accept Answer" and upvote it.

    1 person found this answer helpful.

  4. Badger 56 Reputation points MVP
    2021-06-07T07:47:44.247+00:00

    Hi,

    as Crystal said, you can do this with Powershell or SQL.

    If you're looking for SCOM dashboards not only for this but for a lot more other features you can check out squaredup.com they specialize in SCOM dashboards :)

    Cheers

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.