PowerShell Script Performance Collection Rule (Community)

Community.PowerShellMonitoring.Template.PowerShellRule.PerfCollection (Template)

Collect performance information generated by a PowerShell script.

Source Code:

<Template ID="Community.PowerShellMonitoring.Template.PowerShellRule.PerfCollection" Purpose="RuleCreation">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ID" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Name" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Enabled" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Description" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Target" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Category" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="LocaleId" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="IntervalSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SyncTime" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ScriptName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Arguments" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ScriptBody" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TimeoutSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ObjectName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CounterName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="InstanceName" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Value" type="xsd:string"/>
</Configuration>
<References>
<Reference ID="Self"/>
<Reference ID="System"/>
<Reference ID="Windows"/>
<Reference ID="SC"/>
<Reference ID="SCDW"/>
</References>
<Implementation>
<Monitoring>
<Rules>
<Rule ID="$TemplateConfig/ID$" Target="$TemplateConfig/Target$" Enabled="$TemplateConfig/Enabled$">
<Category>$TemplateConfig/Category$</Category>
<DataSources>
<DataSource ID="DS" TypeID="$Reference/Self$Community.PowerShellMonitoring.DataSource.PowerShellPerformance">
<IntervalSeconds>$TemplateConfig/IntervalSeconds$</IntervalSeconds>
<SyncTime>$TemplateConfig/SyncTime$</SyncTime>
<ScriptName>$TemplateConfig/ScriptName$</ScriptName>
<Arguments>$TemplateConfig/Arguments$</Arguments>
<ScriptBody><Script>$TemplateConfig/ScriptBody$</Script></ScriptBody>
<TimeoutSeconds>$TemplateConfig/TimeoutSeconds$</TimeoutSeconds>
<ObjectName>$TemplateConfig/ObjectName$</ObjectName>
<CounterName>$TemplateConfig/CounterName$</CounterName>
<InstanceName>$TemplateConfig/InstanceName$</InstanceName>
<Value>$TemplateConfig/Value$</Value>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WriteToDB" TypeID="$Reference/SC$Microsoft.SystemCenter.CollectPerformanceData"/>
<WriteAction ID="WriteToDW" TypeID="$Reference/SCDW$Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData"/>
</WriteActions>
</Rule>
</Rules>
</Monitoring>
<LanguagePacks>
<LanguagePack ID="$TemplateConfig/LocaleId$" IsDefault="true">
<DisplayStrings>
<DisplayString ElementID="$TemplateConfig/ID$">
<Name>$TemplateConfig/Name$</Name>
<Description>$TemplateConfig/Description$</Description>
</DisplayString>
</DisplayStrings>
</LanguagePack>
</LanguagePacks>
</Implementation>
</Template>