Have you ever wanted to simply click a server object and see all of the effective rule and monitor configuration settings in one view? Now you can.
NOTES:
This dashboard isn’t perfect. I’ve seen some weird behavior on occasion. Sometimes the top right widget will update with content from other widgets that exist in other views in other folders. Perhaps the Powershell runspace is sharing scope with other dashboards?. Let me know if you find ways to improve it.
If you select ONLY one computer object (top left), expect to see the entire list of configurations for ALL contained subitems appear in the bottom widget. This may take a minute to enumerate so be patient. If you select more than one computer you will only see output for the first computer, not multiple computers. This is by design.
Select a subitem (top right) and ONLY the configuration for THAT item will appear in the bottom widget.
Param($globalSelectedItems) foreach ($globalSelectedItem in $globalSelectedItems) { If ( ($globalSelectedItem["Id"].Length -ge 4 ) ) # Prevent scripts from fighting each other { $globalSelectedItemInstance = Get-SCOMClassInstance -Id $globalSelectedItem["Id"] foreach ($relatedItem in $globalSelectedItemInstance.GetRelatedMonitoringObjects() ) { $dataObject = $ScriptContext.CreateFromObject($relatedItem, "Id=Id,State=HealthState,DisplayName=DisplayName", $null) $dataObject["ParentRelatedObject"] = $globalSelectedItemInstance.DisplayName $ScriptContext.ReturnCollection.Add($dataObject) } } }
Bottom
Effective Configuration of Selected Object (Please wait patiently. This may take a minute…)
################################################################################################### # EffectiveMonitoringConfiguration # Author: Tyson Paul ( ) # Date: 1/14/2015 # # Will recursively find contained instances on a Windows Computer and ouput the effective monitoring configurations/settings to individual output files # Will merge all resulting files into one .csv file, delimited by pipes '|' ################################################################################################### Param($globalSelectedItems)
If ($proceed) { $oEvent = New-Object -comObject "MOM.ScriptAPI" $oEvent.LogScriptEvent("$ThisScript",$EventID,$Type,$output) }
} #endregion Function ##################################################################################################### # Function MergeFiles # Will find .csv files and merge them together. Function MergeFiles{ Param( [string]$strTargetFolderPath )
} # EndFunction ################################################################################################### Function Cleanup () { $ErrorActionPreference = "SilentlyContinue" #Depending on when this is called, some variables may not be initialized and clearing could throw benign error. Supress. #Cleanup Get-Variable | Where-Object { $StartupVariables -notcontains $_.Name } | % { Remove-Variable -Name "$($_.Name)" -Force -Scope 1 } } ########################################################################################################
# -------------------------------------------------------------------------------------------------------------------------------------------------------- $WriteToEventLog=0 #Set to 1 or 2 to start logging [int]$info=0 [int]$critical=1 [int]$warning=2
I have been trying for weeks to create a very similar 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 widget 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 you please help me out with a PowerShell script to meet my requirements?
Are you talking about a single table with 60+ rows (one for each of the ~60 computers), each row would include a column for each of the metrics you listed?
Like this:
Name CPU% MEM_USED% ETH% C_Used% D_Used%
Srv1 23 50 2 40 10
Srv2 ….
Srv60 ….
Hi Tyson, Thank you for responding. Yes, that could be more useful if there is a possibility to get all the resources in one single table or having a separate grid created for each of the resources will also meet my requirement.
Zid,
What you are requesting is certainly possible and I have something that is really close, but not exactly what you want. I don’t have time to tweak it. Not this week anyway. Although this would potentially make a neat blog post.
Don’t hold your breath for me though. I think you can do this on your own with a little help.
I wrote a ‘Disk Helper’ management pack a long, long time ago that included a pretty cool PowerShell grid widget for disks. It contains a timed rule (PowerShell script) that would query the DW to harvest disk information, then write the disk stats to a CSV file. The dashboard (Posh grid widget) was very fast because it would pull data from the CSV file, which is very inexpensive. The only drawback is that because this was written so long ago it references the older OS MPs and classes (Server 2003, 2008, 2012/R2) so it won’t be suitable to import if you don’t have those older MPs. No big deal, you can cannibalize it to create your own timed rule then plug in the dashboard code into a grid widget.
This is a really good example of how to build a fast PowerShell Grid Widget with lots of columns of data.
Create timed rules to cache whatever data to a local file (in this case a simple CSV).
Create a Posh grid widget to present the data. FAST.
Thanks for the suggestion. Will check the possibilities to create the dashboard with the references you have attached. But also it would be great if you can consider my request and create a new blog post. I am quite sure it would be of really great help for many to have such dashboards which could monitor all the major resources at one view.
5 Replies to “Operations Manager 2012 R2 UR2 Powershell Grid Widget Effective Monitoring Configuration Dashboard”
Hello Tyson,
I have been trying for weeks to create a very similar 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 widget 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 you please help me out with a PowerShell script to meet my requirements?
Are you talking about a single table with 60+ rows (one for each of the ~60 computers), each row would include a column for each of the metrics you listed?
Like this:
Name CPU% MEM_USED% ETH% C_Used% D_Used%
Srv1 23 50 2 40 10
Srv2 ….
Srv60 ….
Hi Tyson, Thank you for responding. Yes, that could be more useful if there is a possibility to get all the resources in one single table or having a separate grid created for each of the resources will also meet my requirement.
Zid,
What you are requesting is certainly possible and I have something that is really close, but not exactly what you want. I don’t have time to tweak it. Not this week anyway. Although this would potentially make a neat blog post.
Don’t hold your breath for me though. I think you can do this on your own with a little help.
I wrote a ‘Disk Helper’ management pack a long, long time ago that included a pretty cool PowerShell grid widget for disks. It contains a timed rule (PowerShell script) that would query the DW to harvest disk information, then write the disk stats to a CSV file. The dashboard (Posh grid widget) was very fast because it would pull data from the CSV file, which is very inexpensive. The only drawback is that because this was written so long ago it references the older OS MPs and classes (Server 2003, 2008, 2012/R2) so it won’t be suitable to import if you don’t have those older MPs. No big deal, you can cannibalize it to create your own timed rule then plug in the dashboard code into a grid widget.
This is a really good example of how to build a fast PowerShell Grid Widget with lots of columns of data.
Create timed rules to cache whatever data to a local file (in this case a simple CSV).
Create a Posh grid widget to present the data. FAST.
Windows Disk Helper
Thanks for the suggestion. Will check the possibilities to create the dashboard with the references you have attached. But also it would be great if you can consider my request and create a new blog post. I am quite sure it would be of really great help for many to have such dashboards which could monitor all the major resources at one view.