UNIX/Linux Process Monitoring

Microsoft.Unix.Process.Template (Template)

This template allows you to monitor processes on UNIX/Linux computers.

Source Code:

<Template ID="Microsoft.Unix.Process.Template">
<Configuration>
<xsd:element type="xsd:string" name="Namespace"/>
<xsd:element type="xsd:string" name="TypeName"/>
<xsd:element type="xsd:string" name="ProcessName"/>
<xsd:element type="xsd:string" name="MonitoringTargetId"/>
<xsd:element type="xsd:string" name="MonitoringTargetName"/>
<xsd:element type="xsd:string" name="ArgumentsFilterExpression"/>
<xsd:element type="xsd:string" name="AlertSeverity"/>
<xsd:element type="xsd:string" name="MinProcessCount"/>
<xsd:element type="xsd:string" name="MaxProcessCount"/>
<xsd:element type="xsd:string" name="LocaleId"/>
<xsd:element type="xsd:string" name="TypeDisplayName"/>
<xsd:element type="xsd:string" name="TypeDescription"/>
</Configuration>
<References>
<Reference ID="System"/>
<Reference ID="SC"/>
<Reference ID="SCDW"/>
<Reference ID="SystemPerf"/>
<Reference ID="WSM"/>
<Reference ID="Windows"/>
<Reference ID="Self"/>
<Reference ID="Health"/>
<Reference ID="Unix"/>
</References>
<Implementation>
<TypeDefinitions>
<EntityTypes>
<ClassTypes>
<ClassType Hosted="true" Accessibility="Public" Abstract="false" Base="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess" ID="$TemplateConfig/TypeName$"/>
</ClassTypes>
<RelationshipTypes/>
</EntityTypes>
<ModuleTypes/>
<MonitorTypes/>
</TypeDefinitions>
<Monitoring>
<Discoveries>
<Discovery ID="$TemplateConfig/TypeName$.DiscoveryRule" Enabled="false" Target="$Reference/Unix$Microsoft.Unix.Computer" Priority="Normal" Remotable="true" ConfirmDelivery="false">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="$TemplateConfig/TypeName$"/>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="$Reference/Unix$Microsoft.Unix.ScheduledClassSnapshotDataMapper">
<Scheduler>
<SimpleReccuringSchedule>
<Interval Unit="Seconds">14400</Interval>
<SyncTime/>
</SimpleReccuringSchedule>
<ExcludeDates/>
</Scheduler>
<ClassId>$MPElement[Name="$TemplateConfig/TypeName$"]$</ClassId>
<InstanceSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="$Reference/Unix$Microsoft.Unix.Computer"]/PrincipalName$</Name>
<Value>$Target/Property[Type="$Reference/Unix$Microsoft.Unix.Computer"]/PrincipalName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/Instance$</Name>
<Value>$TemplateConfig/TypeName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ProcessName$</Name>
<Value>$TemplateConfig/ProcessName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/AlertSeverity$</Name>
<Value>$TemplateConfig/AlertSeverity$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ArgumentsFilterExpression$</Name>
<Value>$TemplateConfig/ArgumentsFilterExpression$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/MinProcessCount$</Name>
<Value>$TemplateConfig/MinProcessCount$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/MaxProcessCount$</Name>
<Value>$TemplateConfig/MaxProcessCount$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/MonitoringTargetName$</Name>
<Value>$TemplateConfig/MonitoringTargetName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/MonitoringTargetId$</Name>
<Value>$TemplateConfig/MonitoringTargetId$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/System$System.Entity"]/DisplayName$</Name>
<Value>$TemplateConfig/TypeDisplayName$</Value>
</Setting>
</Settings>
</InstanceSettings>
</DataSource>
</Discovery>
</Discoveries>
<Rules>
<Rule ID="Microsoft.Unix.Generic.Process.AvgPctBusy.Collection.$TemplateConfig/TypeName$" Target="$TemplateConfig/TypeName$" Enabled="false" Remotable="true">
<Category>PerformanceCollection</Category>
<DataSources>
<DataSource ID="DS" TypeID="$Reference/Self$Microsoft.Unix.WSMan.ProcessEnumerator.PerfData">
<TargetSystem>$Target/Host/Property[Type="$Reference/Unix$Microsoft.Unix.Computer"]/NetworkName$</TargetSystem>
<ProcessName>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ProcessName$</ProcessName>
<ArgumentsFilterExpression>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ArgumentsFilterExpression$</ArgumentsFilterExpression>
<Interval>300</Interval>
<ObjectName>Process</ObjectName>
<InstanceName>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ProcessName$</InstanceName>
<CounterName>% Processor Time</CounterName>
<PropertyName>AvgPercentBusyTime</PropertyName>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WriteToDB" TypeID="$Reference/SC$Microsoft.SystemCenter.CollectPerformanceData"/>
<WriteAction ID="WriteToDW" TypeID="$Reference/SCDW$Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData"/>
</WriteActions>
</Rule>
<Rule ID="Microsoft.Unix.Generic.Process.UsedMemory.Collection.$TemplateConfig/TypeName$" Target="$TemplateConfig/TypeName$" Enabled="false" Remotable="true">
<Category>PerformanceCollection</Category>
<DataSources>
<DataSource ID="DS" TypeID="$Reference/Self$Microsoft.Unix.WSMan.ProcessEnumerator.PerfData">
<TargetSystem>$Target/Host/Property[Type="$Reference/Unix$Microsoft.Unix.Computer"]/NetworkName$</TargetSystem>
<ProcessName>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ProcessName$</ProcessName>
<ArgumentsFilterExpression>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ArgumentsFilterExpression$</ArgumentsFilterExpression>
<Interval>300</Interval>
<ObjectName>Process</ObjectName>
<InstanceName>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ProcessName$</InstanceName>
<CounterName>Used Memory KBytes</CounterName>
<PropertyName>AvgUsedMemory</PropertyName>
</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>
<Monitors>
<UnitMonitor ID="Microsoft.Unix.Generic.ProcessCount.Monitor.$TemplateConfig/TypeName$" Accessibility="Public" Target="$TemplateConfig/TypeName$" TypeID="$Reference/Self$Microsoft.Unix.WSMan.ProcessCount.MonitorType" Enabled="true" ParentMonitorID="$Reference/Health$System.Health.AvailabilityState">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.Unix.Generic.ProcessCount.AlertMessage.$TemplateConfig/TypeName$">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>$TemplateConfig/AlertSeverity$</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="$Reference/System$System.Entity"]/DisplayName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="$Reference/Unix$Microsoft.Unix.Computer"]/PrincipalName$</AlertParameter2>
<AlertParameter3>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ProcessName$</AlertParameter3>
<AlertParameter4>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/MinProcessCount$</AlertParameter4>
<AlertParameter5>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/MaxProcessCount$</AlertParameter5>
<AlertParameter6>$Data/Context///*[local-name()="Count"]$</AlertParameter6>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState HealthState="Success" MonitorTypeStateID="ProcessCountOK" ID="ProcessCountOK"/>
<OperationalState HealthState="Error" MonitorTypeStateID="ProcessCountError" ID="ProcessCountError"/>
</OperationalStates>
<Configuration>
<TargetSystem>$Target/Host/Property[Type="$Reference/Unix$Microsoft.Unix.Computer"]/NetworkName$</TargetSystem>
<ProcessName>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ProcessName$</ProcessName>
<ArgumentsFilterExpression>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ArgumentsFilterExpression$</ArgumentsFilterExpression>
<MinProcessCount>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/MinProcessCount$</MinProcessCount>
<MaxProcessCount>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/MaxProcessCount$</MaxProcessCount>
<Interval>300</Interval>
</Configuration>
</UnitMonitor>
<UnitMonitor ID="Microsoft.Unix.Generic.Process.PercentBusyTime.Monitor.$TemplateConfig/TypeName$" Accessibility="Public" Target="$TemplateConfig/TypeName$" TypeID="$Reference/Self$Microsoft.Unix.WSMan.Proess.Performance.Average.Threshold.MonitorType" Enabled="false" ParentMonitorID="$Reference/Health$System.Health.PerformanceState">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.Unix.Generic.Process.PercentBusyTime.AlertMessage.$TemplateConfig/TypeName$">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="$Reference/System$System.Entity"]/DisplayName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="$Reference/Unix$Microsoft.Unix.Computer"]/PrincipalName$</AlertParameter2>
<AlertParameter3>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ProcessName$</AlertParameter3>
<AlertParameter4>$Data/Context/Value$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState HealthState="Success" MonitorTypeStateID="UnderThreshold" ID="UnderThreshold"/>
<OperationalState HealthState="Warning" MonitorTypeStateID="OverWarningThreshold" ID="OverWarningThreshold"/>
<OperationalState HealthState="Error" MonitorTypeStateID="OverErrorThreshold" ID="OverErrorThreshold"/>
</OperationalStates>
<Configuration>
<TargetSystem>$Target/Host/Property[Type="$Reference/Unix$Microsoft.Unix.Computer"]/NetworkName$</TargetSystem>
<ProcessName>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ProcessName$</ProcessName>
<ArgumentsFilterExpression>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ArgumentsFilterExpression$</ArgumentsFilterExpression>
<Interval>300</Interval>
<ObjectName>Process</ObjectName>
<CounterName>% Processor Time</CounterName>
<InstanceName>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ProcessName$</InstanceName>
<PropertyName>AvgPercentBusyTime</PropertyName>
<WarningThreshold>40</WarningThreshold>
<ErrorThreshold>60</ErrorThreshold>
<NumSamples>2</NumSamples>
</Configuration>
</UnitMonitor>
<UnitMonitor ID="Microsoft.Unix.Generic.Process.UsedMemoryKBytes.Monitor.$TemplateConfig/TypeName$" Accessibility="Public" Target="$TemplateConfig/TypeName$" TypeID="$Reference/Self$Microsoft.Unix.WSMan.Proess.Performance.Average.Threshold.MonitorType" Enabled="false" ParentMonitorID="$Reference/Health$System.Health.PerformanceState">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.Unix.Generic.Process.UsedMemoryKBytes.AlertMessage.$TemplateConfig/TypeName$">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="$Reference/System$System.Entity"]/DisplayName$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="$Reference/Unix$Microsoft.Unix.Computer"]/PrincipalName$</AlertParameter2>
<AlertParameter3>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ProcessName$</AlertParameter3>
<AlertParameter4>$Data/Context/Value$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState HealthState="Success" MonitorTypeStateID="UnderThreshold" ID="UnderThreshold"/>
<OperationalState HealthState="Warning" MonitorTypeStateID="OverWarningThreshold" ID="OverWarningThreshold"/>
<OperationalState HealthState="Error" MonitorTypeStateID="OverErrorThreshold" ID="OverErrorThreshold"/>
</OperationalStates>
<Configuration>
<TargetSystem>$Target/Host/Property[Type="$Reference/Unix$Microsoft.Unix.Computer"]/NetworkName$</TargetSystem>
<ProcessName>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ProcessName$</ProcessName>
<ArgumentsFilterExpression>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ArgumentsFilterExpression$</ArgumentsFilterExpression>
<Interval>300</Interval>
<ObjectName>Process</ObjectName>
<CounterName>Used Memory KBytes</CounterName>
<InstanceName>$Target/Property[Type="$Reference/Self$Microsoft.SystemCenter.MonitoredUnixProcess"]/ProcessName$</InstanceName>
<PropertyName>AvgUsedMemory</PropertyName>
<WarningThreshold>262144</WarningThreshold>
<ErrorThreshold>524288</ErrorThreshold>
<NumSamples>2</NumSamples>
</Configuration>
</UnitMonitor>
</Monitors>
<Overrides>
<DiscoveryPropertyOverride ID="$TemplateConfig/TypeName$.DiscoveryOverride" Property="Enabled" Discovery="$TemplateConfig/TypeName$.DiscoveryRule" Enforced="false" ContextInstance="$TemplateConfig/MonitoringTargetId$" Context="$Reference/Unix$Microsoft.Unix.Computer">
<Value>true</Value>
</DiscoveryPropertyOverride>
</Overrides>
</Monitoring>
<PresentationTypes/>
<Presentation>
<StringResources>
<StringResource ID="Microsoft.Unix.Generic.ProcessCount.AlertMessage.$TemplateConfig/TypeName$"/>
<StringResource ID="Microsoft.Unix.Generic.Process.PercentBusyTime.AlertMessage.$TemplateConfig/TypeName$"/>
<StringResource ID="Microsoft.Unix.Generic.Process.UsedMemoryKBytes.AlertMessage.$TemplateConfig/TypeName$"/>
</StringResources>
</Presentation>
<LanguagePacks>
<LanguagePack ID="$TemplateConfig/LocaleId$" IsDefault="true">
<DisplayStrings>
<DisplayString ElementID="$TemplateConfig/TypeName$">
<Name>$TemplateConfig/TypeDisplayName$</Name>
<Description>$TemplateConfig/TypeDescription$</Description>
</DisplayString>
<!-- Discovery -->
<DisplayString ElementID="$TemplateConfig/TypeName$.DiscoveryRule">
<Name>$TemplateConfig/TypeDisplayName$ Process Discovery</Name>
<Description>UNIX/Linux process count monitor</Description>
</DisplayString>
<!-- Rules -->
<DisplayString ElementID="Microsoft.Unix.Generic.Process.AvgPctBusy.Collection.$TemplateConfig/TypeName$">
<Name>UNIX/Linux Process Percent Processor Time Collection - $TemplateConfig/TypeDisplayName$</Name>
<Description>This rule collects the percent processor time (user + system) for the monitored process. If multiple instances of the process exist, the percent processor time is averaged for all instances.</Description>
</DisplayString>
<DisplayString ElementID="Microsoft.Unix.Generic.Process.UsedMemory.Collection.$TemplateConfig/TypeName$">
<Name>UNIX/Linux Process Used Memory KBytes Collection - $TemplateConfig/TypeDisplayName$</Name>
<Description>This rule collects the Kilobytes of used memory for the monitored process. If multiple instances of the process exist, the used memory is averaged for all instances.</Description>
</DisplayString>
<!-- Monitors -->
<DisplayString ElementID="Microsoft.Unix.Generic.ProcessCount.Monitor.$TemplateConfig/TypeName$">
<Name>UNIX/Linux Process Count Monitor - $TemplateConfig/TypeDisplayName$</Name>
<Description>UNIX/Linux process count monitor</Description>
</DisplayString>
<DisplayString ElementID="Microsoft.Unix.Generic.ProcessCount.Monitor.$TemplateConfig/TypeName$" SubElementID="ProcessCountOK">
<Name>Process Count Normal</Name>
<Description>Process Count Normal</Description>
</DisplayString>
<DisplayString ElementID="Microsoft.Unix.Generic.ProcessCount.Monitor.$TemplateConfig/TypeName$" SubElementID="ProcessCountError">
<Name>Process Count Error</Name>
<Description>Process Count Error</Description>
</DisplayString>
<DisplayString ElementID="Microsoft.Unix.Generic.ProcessCount.AlertMessage.$TemplateConfig/TypeName$">
<Name>Process Count is Outside of Range - $TemplateConfig/TypeDisplayName$</Name>
<Description>The count ({5}) of running instances of the {2} ({0}) process on server {1} is outside of the defined threshold range ({3}-{4}). </Description>
</DisplayString>
<!-- Microsoft.Unix.Generic.Process.PercentBusyTime.Monitor.$TemplateConfig/TypeName$-->
<DisplayString ElementID="Microsoft.Unix.Generic.Process.PercentBusyTime.Monitor.$TemplateConfig/TypeName$">
<Name>UNIX/Linux Process Percent Processor Time Monitor - $TemplateConfig/TypeDisplayName$</Name>
<Description>This monitor generates an alert if the percentage of processor time (user + system) used by the process exceeds the threshold. If multiple instances of the process exist, the percent processor time is averaged for all instances.</Description>
</DisplayString>
<DisplayString ElementID="Microsoft.Unix.Generic.Process.PercentBusyTime.Monitor.$TemplateConfig/TypeName$" SubElementID="UnderThreshold">
<Name>Under Threshold</Name>
<Description>Under Threshold</Description>
</DisplayString>
<DisplayString ElementID="Microsoft.Unix.Generic.Process.PercentBusyTime.Monitor.$TemplateConfig/TypeName$" SubElementID="OverWarningThreshold">
<Name>Over Warning Threshold</Name>
<Description>Over Warning Threshold</Description>
</DisplayString>
<DisplayString ElementID="Microsoft.Unix.Generic.Process.PercentBusyTime.Monitor.$TemplateConfig/TypeName$" SubElementID="OverErrorThreshold">
<Name>Over Error Threshold</Name>
<Description>Over Error Threshold</Description>
</DisplayString>
<DisplayString ElementID="Microsoft.Unix.Generic.Process.PercentBusyTime.AlertMessage.$TemplateConfig/TypeName$">
<Name>Processor Time Used by Process is High - $TemplateConfig/TypeDisplayName$</Name>
<Description>The percentage of CPU time ({3}) of running instances of the {2} ({0}) process on server {1} exceeds the threshold. </Description>
</DisplayString>
<!-- Microsoft.Unix.Generic.Process.UsedMemoryKBytes.Monitor.$TemplateConfig/TypeName$-->
<DisplayString ElementID="Microsoft.Unix.Generic.Process.UsedMemoryKBytes.Monitor.$TemplateConfig/TypeName$">
<Name>UNIX/Linux Process Used KBytes Memory Monitor - $TemplateConfig/TypeDisplayName$</Name>
<Description>This monitor generates an alert if the Kilobytes of memory used by the process exceed the threshold. If multiple instances of the process exist, the used memory value is averaged for all instances.</Description>
</DisplayString>
<DisplayString ElementID="Microsoft.Unix.Generic.Process.UsedMemoryKBytes.Monitor.$TemplateConfig/TypeName$" SubElementID="UnderThreshold">
<Name>Under Threshold</Name>
<Description>Under Threshold</Description>
</DisplayString>
<DisplayString ElementID="Microsoft.Unix.Generic.Process.UsedMemoryKBytes.Monitor.$TemplateConfig/TypeName$" SubElementID="OverWarningThreshold">
<Name>Over Warning Threshold</Name>
<Description>Over Warning Threshold</Description>
</DisplayString>
<DisplayString ElementID="Microsoft.Unix.Generic.Process.UsedMemoryKBytes.Monitor.$TemplateConfig/TypeName$" SubElementID="OverErrorThreshold">
<Name>Over Error Threshold</Name>
<Description>Over Error Threshold</Description>
</DisplayString>
<DisplayString ElementID="Microsoft.Unix.Generic.Process.UsedMemoryKBytes.AlertMessage.$TemplateConfig/TypeName$">
<Name>Memory Used by Process is High - $TemplateConfig/TypeDisplayName$</Name>
<Description>The KB of Memory used ({3}) by running instances of the {2} ({0}) process on server {1} exceeds the threshold. </Description>
</DisplayString>
</DisplayStrings>
</LanguagePack>
</LanguagePacks>
</Implementation>
</Template>