2014-05-26

Microsoft has shipped the long awaited and promised widgets for building new and cool dashboards. The System Center Operations Manager Team has released a short documentation and a bit more details you will find on TechNet Wiki:

System Center Operations Manager Engineering Blog

TechNet Wiki Operations Manager Dashboard Widgets

One information which you won’t find is, that these widgets are NOT ONLY available for SCOM 2012 R2 UR2 but also in SCOM 2012 SP1 UR6. Microsoft has shown it at Tech Ed NA 2104 on a slide in session DCIM-B329



As I am exploring these widgets, there are two widgets I really got into (and as I have seen also others) because they will allow you to do almost anything. One is the PowerShell Grid Widget and the other is the PowerShell Web Browser Widget.

My goal is to click onto a computer object and then displaying its location on a map like Bing Maps or Google Maps. To realize this, I remembered that you can provide latitude and longitude to the SCOM 2012 agent to set its location. So why not use this information? It seems that Tao Yang had a similar idea as I, but was choosing the more complicated way :) .

Find latitude / longitude

First you need to figure out what the latitude and longitude of your location is. You could use for example http://www.latlong.net/ to get the values, e.g. Bern (in Switzerland).



Configure the location and agent

Open the PowerShell command and set the location…

New-SCOMLocation -DisplayName “Bern” -Latitude 46.94 -Longitude 7.44



Next assign the location to the SCOM agent e.g. Bern…

$location = Get-SCOMLocation -DisplayName “Bern”
$agent = Get-SCOMAgent -Name “DC01.bigfirm.com”
Set-SCOMLocation -Location $Location -Agent $agent

 

I repeated these steps for another agent called VMM2012R2.bigfirm.com and assigned the “New York” location.

Build the dashboards

Next we create a 3 cell dashboard, basically the frame…

Build computer widget

For the top left cell add the PowerShell Grid Widget…

Then I added the following script…

After you finish the widget, it will look like this…

Build bing map widget

The idea is, that you select a computer from the first widget and then get in context the location. In order to do this, add in the lower large space the PowerShell Web Widget

…and add the following code…

If you click on VMM2012R2.bigfirm.com server bing maps will show the location…

Build Google maps widget

Of course you can also use Google maps, which has a clearer appearance out of the box. To utilize it you need to change the code a bit, like this…

If you click VMM2012R2.bigfirm.com again, it will look like this…

As you can see, we are just using the built in functionality of the SCOM agent to get its location displayed on any map by providing a properly formatted URL. In addition I was able to list the computers in a separated widget and add a custom column with the location / city name. To display the logos I simply used the Image Widget.

This is just touching the surface of all the possibilities. I am not sure if there is an easy way to debug the widgets, but I started just writing log files to figure out what exactly is going on. Hopefully Microsoft will provide some more tutorials.

I put the code for download on OneDrive.

Have fun!

Filed under: Dashboard, Management Pack, Script

Show more