MailIn Generic CleanEmlArchive.Rule

SCOM.Addons.MailIn.CleanEmlArchive.Rule (Rule)

Removes archived eml files in archive folder older than confiugured retention.

Element properties:

TargetSCOM.Addons.MailIn.MonitoringServer
CategoryCustom
EnabledTrue
Alert GenerateTrue
Alert SeverityInformation
Alert PriorityNormal
RemotableTrue
Alert Message
MailIn Clean EmlArchive Rule

Title:
{0}

Eml Files in Archive:
{1}

Deleted Eml File Number:
{2}

Deleted Eml File details:
{3}

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource SCOM.Addons.MailIn.CleanEmlArchive.Rule.Datasource Default
CD ConditionDetection System.ExpressionFilter Default
WA WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="SCOM.Addons.MailIn.CleanEmlArchive.Rule" Enabled="true" Target="SCOM.Addons.MailIn.MonitoringServer" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>Custom</Category>
<DataSources>
<DataSource ID="DS" TypeID="SCOM.Addons.MailIn.CleanEmlArchive.Rule.Datasource">
<IntervalSeconds>600</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>120</TimeoutSeconds>
<EmlArchive>C:\Temp\MailArchive</EmlArchive>
<EmlRetentionHours>720</EmlRetentionHours>
</DataSource>
</DataSources>
<ConditionDetection ID="CD" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='Result']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">BAD</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
<WriteActions>
<WriteAction ID="WA" TypeID="Health!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>0</Severity>
<AlertMessageId>$MPElement[Name="SCOM.Addons.MailIn.CleanEmlArchive.Rule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/Property[@Name='Title']$</AlertParameter1>
<AlertParameter2>$Data/Property[@Name='EmlCount']$</AlertParameter2>
<AlertParameter3>$Data/Property[@Name='EmlToDel']$</AlertParameter3>
<AlertParameter4>$Data/Property[@Name='EmlInfo']$</AlertParameter4>
</AlertParameters>
<Suppression/>
</WriteAction>
</WriteActions>
</Rule>