Condividi tramite


OpsMgr: Sample Tile Map Widget Template

This blog post features a sample management pack that consist of a widget template that allows the user to create custom Tile Map widgets for monitored objects, from the output of PowerShell scripts via a UI within a dashboard layout in the OpsMgr 2012 Operations Console. 

This sample management pack library can now be downloaded from the TechNet Gallery.

image

 

This Tile Map Widget template is defined in a management pack with a display name of Sample Tile Map Widget Component Library and references the tile map component in the Microsoft System Center Management Pack for VMM Host and VM Dashboards Visualization Components (Microsoft.SystemCenter.VMMHostVM.Visualization.Components.mpb).
Therefore, the Microsoft.SystemCenter.VMMHostVM.Visualization.Components management pack bundle (download center) must be imported before or together with the Sample Tile Map Widget Component Library.

Importing the management pack into a OpsMgr 2012 R2 environment will allow the widget template to appear under the "All Templates/WeiOutThere Tile Map" folder in the "New Dashboard and Widget Wizard" page:

image

 

To create an instance of this custom Tile Map widget, first create a dashboard layout (with n-cells), Click to add widget on a cell, then select the Sample Tile Map Widget template, go through the UI pages of the template and enter the required information.

  1. On the “General Properties” page, enter a name for the widget.

    image

  2. On the "PowerShell Script" page, the page is already pre-filled with a sample script that consist of all the key properties that utilizes the ScriptContext helper object ( $dataObject = $ScriptContext.CreateFromObject ... ), to create objects to be represented as tiles on the Tile Map widget.

    image

    Note that filtering works for the following fields

    :
    HealthState, DisplayName, Description, Cloud, HostName, VMMServer, State

    image

    For the HealthState field, here are the allowed values:
    - For Healthy State/Green Tile:
    $dataObject[“HealthState”]=
    $ScriptContext.CreateWellKnownType("xsd://Microsoft.SystemCenter.Visualization.Library!Microsoft.SystemCenter.Visualization.OperationalDataTypes/MonitoringObjectHealthStateType",1)

    - For Warning State/Yellow Tile:
    $dataObject[“HealthState”]=
    $ScriptContext.CreateWellKnownType("xsd://Microsoft.SystemCenter.Visualization.Library!Microsoft.SystemCenter.Visualization.OperationalDataTypes/MonitoringObjectHealthStateType",2)

    - For Error/Critical State/RedTile:
    $dataObject[“HealthState”]=
    $ScriptContext.CreateWellKnownType("xsd://Microsoft.SystemCenter.Visualization.Library!Microsoft.SystemCenter.Visualization.OperationalDataTypes/MonitoringObjectHealthStateType",3)

    - For Uninitialized State:
    $dataObject[“HealthState”]=
    $ScriptContext.CreateWellKnownType("xsd://Microsoft.SystemCenter.Visualization.Library!Microsoft.SystemCenter.Visualization.OperationalDataTypes/MonitoringObjectHealthStateType",0)

  3. On the “Refresh Interval” page, enter a numerical value for the refresh interval of the widget (in seconds).
    Note that the default refresh interval for the Tile Map widget is set at 300 seconds (i.e. refreshes every 5 minutes). 

    image

  4. On the “Tile Map Title” page, provide a name or title for the Tile Map widget if applicable, or leave it blank.

    image

     

  5. On the “Tile Size” page, enter a numerical value for the size of the tiles on the Tile Map:

    If the value provided is greater than 80, the display name assigned to the monitored object will be displayed on the tile.

    image

    image

    If the value provided is less than 80, the display name assigned to the monitored object will NOT be displayed on the smaller tile.

    image

    image

     

  6. Click the Finish button to create the custom Tile Map widget.

    image

 

 

Here is a sample script that can be used by a Tile Map widget to display all logical entities as tiles on a tile map based on their current health state:

#//////////////////////////////////////////////////////////////////////////////////////////////////////

$class = get-scomclass -Name System.LogicalEntity
$logicalEntities = Get-SCOMClassInstance -class $class

foreach($logicalObject in $logicalEntities) {

$dataObject = $ScriptContext.CreateFromObject($logicalObject, "Id=Id,Name=Name", $null)

$dataObject["DisplayName"] = $logicalObject.DisplayName

if($logicalObject.HealthState -eq "Success") {
$dataObject["HealthState"] = $ScriptContext.CreateWellKnownType("xsd://Microsoft.SystemCenter.Visualization.Library!Microsoft.SystemCenter.Visualization.OperationalDataTypes/MonitoringObjectHealthStateType",1)
}
if($logicalObject.HealthState -eq "Error") {
$dataObject["HealthState"] = $ScriptContext.CreateWellKnownType("xsd://Microsoft.SystemCenter.Visualization.Library!Microsoft.SystemCenter.Visualization.OperationalDataTypes/MonitoringObjectHealthStateType",3)
}
if($logicalObject.HealthState -eq "Warning") {
$dataObject["HealthState"] = $ScriptContext.CreateWellKnownType("xsd://Microsoft.SystemCenter.Visualization.Library!Microsoft.SystemCenter.Visualization.OperationalDataTypes/MonitoringObjectHealthStateType",2)
}
if($logicalObject.IsAvailable -eq $False) {
$dataObject["HealthState"] = $ScriptContext.CreateWellKnownType("xsd://Microsoft.SystemCenter.Visualization.Library!Microsoft.SystemCenter.Visualization.OperationalDataTypes/MonitoringObjectHealthStateType",0)
}

$ScriptContext.ReturnCollection.Add($dataObject)

}

#//////////////////////////////////////////////////////////////////////////////////////////////////////

Here is what the Tile Map widget would look like when the tile size is set at 40:

image

Mouse-over or single-clicking a tile will display a tooltip that provides more information about the selected tile.

image

 

Double-clicking a tile will launch an Object State Dashboard for the selected object

image 

Filtering by the object Health State results in:

image


Filtering by the object Display Name results in:

 

image 

 

Additional Reference:

Miscellaneous Symbols:
https://en.wikipedia.org/wiki/Miscellaneous_Symbols

 

Thank you for your support !      

 

Disclaimer:
All information on this blog is provided on an as-is basis with no warranties and for informational purposes only. Use at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of my employer.

Comments

  • Anonymous
    March 14, 2016
    Great work!

  • Anonymous
    March 17, 2016
    The comment has been removed

  • Anonymous
    March 25, 2016
    Nice post! Can this widget be contextual?

    • Anonymous
      March 27, 2016
      Yes, you can use the $globalSelectedItems variable to pass context from objects listed in a State Widget.
  • Anonymous
    August 11, 2016
    I made all procedure as described but not appeared this template.has anything to do more?RegardsDouglas