Collect and View Performance Data

適用於: Operations Manager 2007 R2

This topic describes how rules are used to store information for later retrieval in the Operations Manager database.

Add a Rule

Rules are the mechanism by which system data is stored in the Operations Manager database. A monitor reports information only in the moment. Only through logging information in the Operations Manager database is it possible to produce views and reports of past events. A rule resembles a monitor except for the two write actions that occur at the end of the rule definition.

    <Rules>
      <Rule ID="Microsoft.SCX.AuthoringGuide.SampleAppPerf.Collection" Enabled="true" Target="Microsoft.SCX.Sample.Application" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
        <Category>PerformanceCollection</Category>
        <DataSources>
          <DataSource ID="DS" TypeID="Microsoft.SCX.Authoring.Guide.ScriptBased.PerfCounterProvider">
            <IntervalSeconds>30</IntervalSeconds>
            <TargetSystem>$Target/Host/Property[Type="Unix!Microsoft.Unix.Computer"]/PrincipalName$</TargetSystem>
            <Uri>https://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/SCX_OperatingSystem?__cimnamespace=root/scx</Uri>
            <Selector />
            <InvokeAction>ExecuteCommand</InvokeAction>
            <Input><![CDATA[ <p:ExecuteCommand_INPUT xmlns:p="https://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/SCX_OperatingSystem"><p:command>sh /tmp/SampleAppPerf.sh</p:command><p:timeout>10</p:timeout></p:ExecuteCommand_INPUT> ]]></Input>
            <SyncTime />
            <ObjectName>SampleApp</ObjectName>
            <CounterName>SampleValue</CounterName>
            <InstanceName>$Target/Property[Type="Microsoft.SCX.Sample.Application"]/DisplayName$</InstanceName>
            <Value>$Data///*[local-name()="StdOut"]$</Value>
          </DataSource>
        </DataSources>
        <!--Write collected data to Operations Manager database -->
        <WriteActions>
          <WriteAction ID="WriteToDB" TypeID="SC!Microsoft.SystemCenter.CollectPerformanceData" />
          <WriteAction ID="WriteToDW" TypeID="SCDW!Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData" />
        </WriteActions>
      </Rule>
    </Rules>

In the Microsoft.SCX.Authoring.Guide.xml file that you created earlier, insert the preceding XML in the <Rules/> subsection under the <Monitoring> section.

Presentation

The bulk of the definition for the historical data is in the presentation section of the management pack. Such presentation definitions include fonts, sort order, colors, and any attribute that is needed to display the information. Any folders or views are also defined here, though the actual strings are defined in the language pack section.

    <Views>
      <View ID="Microsoft.SCX.Authoring.Guide.SampleApp.Perf.View" Accessibility="Public" Enabled="true" Target="Microsoft.SCX.Sample.Application" TypeID="SC!Microsoft.SystemCenter.PerformanceViewType" Visible="true">
        <Category>Operations</Category>
        <Criteria />
        <Presentation>
          <SortedColumnIndex>0</SortedColumnIndex>
          <SortOrder>0</SortOrder>
          <StartTime>2009-04-20T15:28:00.8351039-07:00</StartTime>
          <EndTime>2009-04-21T15:28:00.8351039-07:00</EndTime>
          <DynamicTimeTicks>864000000000</DynamicTimeTicks>
          <IsDynamic>true</IsDynamic>
          <Is3DMode>false</Is3DMode>
          <ShowAlerts>false</ShowAlerts>
          <ShowMaintenanceMode>false</ShowMaintenanceMode>
          <BaselineMode>false</BaselineMode>
          <ShowPointLabels>false</ShowPointLabels>
          <EnableSmartLabels>true</EnableSmartLabels>
          <RightAngleAxes>false</RightAngleAxes>
          <ClusterSeries>false</ClusterSeries>
          <Title />
          <TitleFont>Microsoft Sans Serif,12,Regular</TitleFont>
          <ChartFont>Microsoft Sans Serif,8.25,Regular</ChartFont>
          <ShowBands>false</ShowBands>
          <BandColor>-1579033</BandColor>
          <ChartType>Line</ChartType>
          <Depth>100</Depth>
          <GapDepth>100</GapDepth>
          <Perspective>10</Perspective>
          <GraphXRotation>0</GraphXRotation>
          <GraphYRotation>0</GraphYRotation>
          <XLabelAngle>0</XLabelAngle>
          <LabelColor>-16777216</LabelColor>
          <LabelFont>Microsoft Sans Serif,8.25,Regular</LabelFont>
          <XAxisVisible>True</XAxisVisible>
          <XShowMajorGridlines>false</XShowMajorGridlines>
          <XShowMinorGridlines>false</XShowMinorGridlines>
          <ShowInterlaceStrips>false</ShowInterlaceStrips>
          <XInterlaceColor>16777215</XInterlaceColor>
          <XShowSideMargin>true</XShowSideMargin>
          <XAxisFont>Microsoft Sans Serif,8.25,Regular</XAxisFont>
          <AutoAxis>true</AutoAxis>
          <AxisMax>100</AxisMax>
          <AxisMin>0</AxisMin>
          <YAxisVisible>True</YAxisVisible>
          <YShowMajorGridlines>true</YShowMajorGridlines>
          <YShowMinorGridlines>false</YShowMinorGridlines>
          <YShowInterlaceStrips>false</YShowInterlaceStrips>
          <YShowSideMargin>true</YShowSideMargin>
          <YAxisFont>Microsoft Sans Serif,8.25,Regular</YAxisFont>
          <BackgroundColor1>-1</BackgroundColor1>
          <BackgroundColor2>-1</BackgroundColor2>
          <GradientType>None</GradientType>
          <Series />
        </Presentation>
        <Target />
      </View>
    </Views>

In the Microsoft.SCX.Authoring.Guide.xml file that you created earlier, insert the preceding XML in the <Presentation> section.

      <Folder ID="Microsoft.SCX.Authoring.Guide.SampleApp.Folder" Accessibility="Public" ParentFolder="SC!Microsoft.SystemCenter.Monitoring.ViewFolder.Root" />

In the Microsoft.SCX.Authoring.Guide.xml file that you created earlier, insert the preceding XML in the <Folders> subsection under the <Presentation> section.

      <FolderItem ElementID="Microsoft.SCX.Authoring.Guide.SampleApp.Perf.View" Folder="Microsoft.SCX.Authoring.Guide.SampleApp.Folder" />

In the Microsoft.SCX.Authoring.Guide.xml file that you created earlier, insert the preceding XML in the <FolderItems> subsection under the <Presentation> section.

Language Pack

The display strings for the performance view and folder are defined as follows:

        <DisplayString ElementID="Microsoft.SCX.Authoring.Guide.SampleApp.Perf.View">
          <Name>Sample Application Performance</Name>
        </DisplayString>
        <DisplayString ElementID="Microsoft.SCX.Authoring.Guide.SampleApp.Folder">
          <Name>Microsoft System Center Cross Platform Management Pack Authoring Guide Sample</Name>
        </DisplayString>

In the Microsoft.SCX.Authoring.Guide.xml file that you created earlier, insert the preceding XML in the <DisplayStrings> subsection under the <LanguagePack> section.

To observe the data collection within Operations Manager, save the file, Microsoft.SCX.Authoring.Guide.xml, and then import the management pack into the Operations Manager management group, as described in the Required Management Pack Definitions topic.

Observing Collected Data

After the management pack that contains the data collection monitor and rule is imported into the Operations console, the collected data can be viewed.

To observe the performance data

  1. In the Operations console, from the monitoring node, verify that there is a folder that is named Microsoft System Center Cross Platform Management Pack Authoring Guide Sample. In the folder is a view for Sample Application Performance.

  2. Click the Sample Application Performance View. Notice that all the data is displayed as a line graph.