Jaa


OpsMgr: Sample Dashboard with Auto Select & Scroll Capabilities

This article features a sample dashboard that is configured to randomly scroll through and select an object from the list of objects available in a State Widget on a preconfigured interval. Together with other contextual widgets, this capability can make a dashboard come to life and can be extended for scenarios where using “automated dashboards” is the more suitable choice to display monitoring data, like in monitoring command centres etc.

Without this feature, a dashboard with a state widget and contextual widgets would require the user to move the selector manually and would probably be more suitable for hands-on analysis or troubleshooting work rather than being used as a command centre dashboard.

image

Thanks to some guidance from my colleague Ryan Benson, I learned that the State Widget’s DataGrid component exposes the selected items collection, and respects other components changing this property programmatically. If a new component which updates the selected items on an interval is written, the auto scroll and select scenario can be achieved. However the only issue is that the visual order of the items in the grid is sorted internally and not exposed, so if the sorting on any of the columns is enabled, the programmatic selection would jump around.

The sample health dashboard consist of a state widget scoped to the Windows Server Operating System Class, a header label widget, a detail widget, a contextual alert widget and a contextual health widget. The management pack containing this sample dashboard can now be downloaded from the TechNet Gallery.

Here is a logical representation of the sample summary dashboard composition:

image     
     
Here is the PowerShell script used in the PowerShell Datasource component to randomly select an instance of the Windows Server Operating System class and return the selected object to SelectedItem field of State Widget’s DataGrid component. This PowerShell script is configured to run at a 15 minute interval:

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

class = get-scomclass -Name Microsoft.Windows.Server.OperatingSystem

$serverOSes = Get-SCOMClassInstance -class $class

$randomobject = Get-Random -InputObject $serverOSes

$dataObject = $ScriptContext.CreateFromObject($randomobject, "Id=Id,State=HealthState,Name=Name", $null)
$dataObject["Path"]=$randomobject.Path

$ScriptContext.ReturnCollection.Add($dataObject)

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

When the sample MP is imported into a OpsMgr 2012 environment, the sample health dashboard will appear at the root of the Monitoring Workspace with display name as: Sample AutoScrolling OS Health Dashboard:

image

 
When an object in the State Widget is selected, the Label Widget will contextually display the name of the server hosting the selected object, the Detail Widget will contextually display the detailed information of the server hosting the selected object, the Contextual Alert Widget will display all the New alerts associated to the selected object and the Contextual Health Widget will display only unhealthy monitors running against the selected object as follows:
  
image
                                  image

After x15 seconds, if an object that is in Healthy state is automatically selected, the following picture provides an example of what the contextual widgets on the dashboard would display:

image      
     

After x15 seconds, if an object that is in Critical state is automatically selected, the following picture provides an example of what the contextual widgets on the dashboard would display:

     image
     
     

After x15 seconds, if an object that is in Maintenance Mode is automatically selected, the following picture provides an example of what the contextual widgets on the dashboard would display:

image

   
Note:
The highlight on the manually selected row will disappear when the auto scroll and select action kick in. Observe the Label Widget to identify the currently selected object:

image

     
     

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
    August 07, 2015
    "><img src=x>