Appendix: Monitors and Overrides for Management Packs
This section provides detailed procedures and scripts that you can use to display rules and other information about the management packs that you import.
How to view management pack details
For more information about a monitor and the associated override values, see the Product Knowledge tab for the monitor.
To view the Product Knowledge tab for a monitor
In the Operations Console, click Authoring.
Expand Management Pack Objects, and then click Monitors.
In the Monitors pane, expand the targets until you reach the desired monitor.
Right-click the monitor, and then click Properties.
Click the Product Knowledge tab.
How to display monitors for a management pack
To display a list of outputs for a management pack's monitors and overrides by using the Command Shell, use the following procedure.
To display monitors for a management pack
Click Start, point to All Programs, point to System Center Operations Manager 2007 R2, and then click Operations Manager Shell.
Type the following command: get-monitor -managementPack name.mp | export-csv filename, where filename is the name of the output file, and then press ENTER.
A .csv file is created. The .csv file can be opened in Microsoft Office Excel.
How to display overrides for a management pack
To display overrides for a management pack, use the following procedure.
To display overrides for a management pack
Click Start, point to All Programs, point to System Center Operations Manager 2007 R2, and then click Operations Manager Shell.
Type the following command: get-override -managementPack name.mp | export-csv filename, where filename is the name of the output file, and then press ENTER.
A .csv file is created. The .csv file can be opened in Microsoft Office Excel.
How to display all management pack rules
To display a list of rules for the management packs that you imported, use the following procedure.
To display management pack rules
Click Start, point to All Programs, point to System Center Operations Manager 2007 R2, and then click Operations Manager Shell.
Type the following command: get-rule | select-object @{Name="MP";Expression={ foreach-object {$_.GetManagementPack().DisplayName }}},DisplayName | sort-object -property MP | export-csv filename, where filename is the name of the output file, and then press ENTER.
A .csv file is created. The .csv file can be opened in Microsoft Office Excel.
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 that can be opened in Microsoft Office Excel, and includes the following columns.
Column | Description |
---|---|
Type |
The type of objects the monitor is targeted to |
DisplayName |
The display name of the monitor |
Threshold |
The threshold used by the monitor |
AlertOnState |
Determines whether the monitor generates an alert when the state changes |
AutoResolveAlert |
Determines whether 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 that can be opened in Microsoft Office Excel, and includes the following columns.
Column | Description |
---|---|
WriteAction |
Contains information about where the performance counter is written |
WriteToDB or CollectionPerformanceData |
Writes to the Operations Manager 2007 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"