Appendix: Monitors and overrides for management packs

 

Applies to: Forefront Protection 2010 for SharePoint

This section provides detailed procedures and scripts that allow you to display rules and other information about the management packs you import.

Viewing management pack details

For more information about a monitor and the associated override values, see the knowledge for the monitor.

To view knowledge for a monitor

  1. In the Operations Console, click the Authoring button.

  2. Expand Management Pack Objects, and then click Monitors.

  3. In the Monitors pane, expand the targets until you reach the monitor level. Alternatively, you can use the Search box to find a particular monitor.

  4. Click the monitor, and in the Monitors pane, click View knowledge.

  5. Click the Product Knowledge tab.

Displaying monitors for a management pack

To use the Forefront Management Shell to display a list of outputs for a management pack's monitors and overrides, use the following procedure.

To display monitors for a management pack

  1. In the Command Shell, type the following command

    get-monitor -managementPack name.mp | export-csv filename

  2. A .csv file is created. The .csv file can be opened in Excel.

    Note

    In Excel, you may be required to specify that the .csv file is a text file.

Displaying overrides for a management pack

To display overrides for a management pack, use the following procedure.

To display overrides for a management pack

  1. In the Command Shell, type the following command

    get-override -managementPack name.mp | export-csv filename

  2. A .csv file is created. The .csv file can be opened in Excel.

    Note

    In Excel, you may be required to specify that the .csv file is a text file.

For example, this command displays the overrides for one of the core management packs:

get-override -managementPack Microsoft.SystemCenter.OperationsManager.Internal.mp | export-csv "c:\overrides.csv"

How to display all management pack rules

Use the following procedure to display a list of rules for the management packs that you imported. The list of rules can be viewed in Excel.

To display management pack rules

  1. In your management server, click Programs, and then click System Center.

  2. Click Command Shell.

  3. In the command shell window, type the following command:

    get-rule | select-object @{Name="MP";Expression={ foreach-object {$_.GetManagementPack().DisplayName }}},DisplayName | sort-object -property MP | export-csv "c:\rules.csv"
    
  4. A .csv file is created. The .csv file can be opened in Excel.

    Note

    In Excel, you may be required to specify that the .csv file is a text file.

How to display monitor thresholds

To display monitor thresholds, use the script described in this section. This script works for the majority of monitors. It creates a .csv file with the following columns and can be viewed using Excel:

Column

Description

Type

The type of objects to which the monitor is targeted

DisplayName

The display name of the monitor

Threshold

The threshold used by the monitor

AlertOnState

Determines if the monitor generates an alert when the state changes

AutoResolveAlert

Determines if the generated alert will be automatically resolved when the monitor state goes back to green

AlertSeverity

The severity of the generated alert

Run the following script to create the .csv file that displays the monitor thresholds:

function GetThreshold ([String] $configuration)
{
$config = [xml] ("<config>" + $configuration + "</config>")
$threshold = $config.Config.Threshold
if($threshold -eq $null)
{
$threshold = $config.Config.MemoryThreshold
}
if($threshold -eq $null)
{
$threshold = $config.Config.CPUPercentageThreshold
}
if($threshold -eq $null)
{
if($config.Config.Threshold1 -ne $null -and $config.Config.Threshold2 -ne $null)
{
$threshold = "first threshold is: " + $config.Config.Threshold1 + " second threshold is: " + $config.Config.Threshold2
}
}
if($threshold -eq $null)
{
if($config.Config.ThresholdWarnSec -ne $null -and $config.Config.ThresholdErrorSec -ne $null)
{
 $threshold = "warning threshold is: " + $config.Config.ThresholdWarnSec + " error threshold is: " + $config.Config.ThresholdErrorSec 
}
}
if($threshold -eq $null)
{
if($config.Config.LearningAndBaseliningSettings -ne $null)
{
$threshold = "no threshold (baseline monitor)"
}
}
return $threshold
}
$perfMonitors = get-monitor -Criteria:"IsUnitMonitor=1 and Category='PerformanceHealth'"
$perfMonitors | select-object @{name="Target";expression={foreach-object {(Get-MonitoringClass -Id:$_.Target.Id).DisplayName}}},DisplayName, @{name="Threshold";expression={foreach-object {GetThreshold $_.Configuration}}}, @{name="AlertOnState";expression={foreach-object {$_.AlertSettings.AlertOnState}}}, @{name="AutoResolveAlert";expression={foreach-object {$_.AlertSettings.AutoResolve}}}, @{name="AlertSeverity";expression={foreach-object {$_.AlertSettings.AlertSeverity}}} | sort Target, DisplayName | export-csv "c:\monitor_thresholds.csv"

How to display performance collection rules

To display performance collection rules, use the script in this section. This script works for the majority of monitors. It creates a .csv file with the following columns and can be viewed using Excel.

Column

Description

WriteAction

Contains information about where the performance counter is written

WriteToDB or CollectionPerformanceData

Writes to the Operations Manager database

WriteToDW or CollectPerfDataWarehouse

Writes to the data warehouse

WC

Stores baseline data for a performance counter into the operational database

To display the performance collection rules present in the management group, run the following script:

function GetPerfCounterName ([String] $configuration)
{
$config = [xml] ("<config>" + $configuration + "</config>")
return ($config.Config.ObjectName + "\" + $config.Config.CounterName)
}
function GetFrequency ([String] $configuration)
{
$config = [xml] ("<config>" + $configuration + "</config>")
$frequency = $config.Config.Frequency;
if($frequency -eq $null)
{
$frequency = $config.Config.IntervalSeconds;
}
return ($frequency)
}
function GetDisplayName($performanceRule)
{
 if($performanceRule.DisplayName -eq $null)
 {
  return ($performanceRule.Name);
 }
 else
 {
  return ($performanceRule.DisplayName);
 }
}
function GetWriteActionNames($performanceRule)
{
 $writeActions = ""; 
 foreach($writeAction in $performanceRule.WriteActionCollection)
 {
  $writeActions += " " + $writeAction.Name;
 }
 return ($writeActions);
}
$perf_collection_rules = get-rule -criteria:"Category='PerformanceCollection'"
$perf_collection_rules | select-object @{name="Type";expression={foreach-object {(Get-MonitoringClass -id:$_.Target.Id).DisplayName}}},@{name="RuleDisplayName";expression={foreach-object {GetDisplayName $_}}} ,@{name="CounterName";expression={foreach-object {GetPerfCounterName $_.DataSourceCollection[0].Configuration}}},@{name="Frequency";expression={foreach-object {GetFrequency $_.DataSourceCollection[0].Configuration}}},@{name="WriteActions";expression={foreach-object {GetWriteActionNames $_}}}  | sort Type,RuleDisplayName,CounterName | export-csv "c:\perf_collection_rules.csv"