Snmp Trap (Alert)

Microsoft.SystemCenter.RuleTemplates.SnmpTrapAlert (Template)

Generate an alert in response to SNMP traps

Source Code:

<Template ID="Microsoft.SystemCenter.RuleTemplates.SnmpTrapAlert" Purpose="RuleCreation">
<Configuration>
<IncludeSchemaTypes>
<SchemaType>System!System.ParamListSchema</SchemaType>
<SchemaType>Health!System.Health.AlertSchema</SchemaType>
<SchemaType>RuleTemplates!Microsoft.SystemCenter.RuleTemplates.ManagementPackCategoryType</SchemaType>
<SchemaType>RuleTemplates!Microsoft.SystemCenter.RuleTemplates.ManagementPackIdentifiers</SchemaType>
</IncludeSchemaTypes>
<xsd:element name="ID" type="ManagementPackUniqueIdentifier"/>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="Enabled" type="xsd:boolean"/>
<xsd:element name="Description" type="xsd:string"/>
<xsd:element name="Target" type="xsd:string"/>
<xsd:element name="Category" type="ManagementPackCategoryType"/>
<xsd:element name="LocaleId" type="ManagementPackLanguageIdentifier"/>
<xsd:element minOccurs="1" maxOccurs="1" name="IP" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="Version" type="xsd:string"/>
<xsd:element minOccurs="0" maxOccurs="1" name="OIDProps">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="OIDProp" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="EventOriginId" type="xsd:string"/>
<xsd:element name="PublisherId" type="xsd:string"/>
<xsd:element name="PublisherName" type="xsd:string"/>
<xsd:element name="Channel" type="xsd:string"/>
<xsd:element name="LoggingComputer" type="xsd:string"/>
<xsd:element name="EventNumber" type="xsd:string"/>
<xsd:element name="EventCategory" type="xsd:string"/>
<xsd:element name="EventLevel" type="xsd:string"/>
<xsd:element name="UserName" type="xsd:string"/>
<xsd:element name="Description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Params" type="ParamListType"/>
<xsd:element name="Priority">
<xsd:simpleType>
<xsd:restriction base="xsd:integer">
<xsd:minInclusive value="0"/>
<xsd:maxInclusive value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Severity">
<xsd:simpleType>
<xsd:restriction base="xsd:integer">
<xsd:minInclusive value="0"/>
<xsd:maxInclusive value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AlertName" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="AlertDescription" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="AlertOwner" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="AlertParameters" type="System.Health.AlertParameters" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Suppression" type="System.Health.Suppression" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Custom1" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Custom2" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Custom3" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Custom4" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Custom5" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Custom6" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Custom7" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Custom8" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Custom9" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="Custom10" type="xsd:string" minOccurs="0" maxOccurs="1"/>
</Configuration>
<References>
<Reference ID="System"/>
<Reference ID="NetworkLibrary"/>
<Reference ID="Health"/>
</References>
<Implementation>
<Monitoring>
<Rules>
<Rule ID="$TemplateConfig/ID$" Target="$TemplateConfig/Target$" Enabled="$TemplateConfig/Enabled$">
<Category>$TemplateConfig/Category$</Category>
<DataSources>
<DataSource ID="DS" TypeID="$Reference/NetworkLibrary$System.NetworkManagement.SnmpTrapEventProvider">
<IP>$TemplateConfig/IP$</IP>
<Version>$TemplateConfig/Version$</Version>
<OIDProps>$TemplateConfig/OIDProps$</OIDProps>
<EventOriginId>$TemplateConfig/EventOriginId$</EventOriginId>
<PublisherId>$TemplateConfig/PublisherId$</PublisherId>
<PublisherName>$TemplateConfig/PublisherName$</PublisherName>
<Channel>$TemplateConfig/Channel$</Channel>
<LoggingComputer>$TemplateConfig/LoggingComputer$</LoggingComputer>
<EventNumber>$TemplateConfig/EventNumber$</EventNumber>
<EventCategory>$TemplateConfig/EventCategory$</EventCategory>
<EventLevel>$TemplateConfig/EventLevel$</EventLevel>
<UserName>$TemplateConfig/UserName$</UserName>
<Params>$TemplateConfig/Params$</Params>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="Alert" TypeID="$Reference/Health$System.Health.GenerateAlert">
<Priority>$TemplateConfig/Priority$</Priority>
<Severity>$TemplateConfig/Severity$</Severity>
<AlertName>$TemplateConfig/AlertName$</AlertName>
<AlertDescription>$TemplateConfig/AlertDescription$</AlertDescription>
<AlertOwner>$TemplateConfig/AlertOwner$</AlertOwner>
<AlertMessageId>$MPElement[Name="$TemplateConfig/ID$.AlertMessage"]$</AlertMessageId>
<AlertParameters>$TemplateConfig/AlertParameters$</AlertParameters>
<Suppression>$TemplateConfig/Suppression$</Suppression>
<Custom1>$TemplateConfig/Custom1$</Custom1>
<Custom2>$TemplateConfig/Custom2$</Custom2>
<Custom3>$TemplateConfig/Custom3$</Custom3>
<Custom4>$TemplateConfig/Custom4$</Custom4>
<Custom5>$TemplateConfig/Custom5$</Custom5>
<Custom6>$TemplateConfig/Custom6$</Custom6>
<Custom7>$TemplateConfig/Custom7$</Custom7>
<Custom8>$TemplateConfig/Custom8$</Custom8>
<Custom9>$TemplateConfig/Custom9$</Custom9>
<Custom10>$TemplateConfig/Custom10$</Custom10>
</WriteAction>
</WriteActions>
</Rule>
</Rules>
</Monitoring>
<Presentation>
<StringResources>
<StringResource ID="$TemplateConfig/ID$.AlertMessage"/>
</StringResources>
</Presentation>
<LanguagePacks>
<LanguagePack ID="$TemplateConfig/LocaleId$" IsDefault="true">
<DisplayStrings>
<DisplayString ElementID="$TemplateConfig/ID$">
<Name>$TemplateConfig/Name$</Name>
<Description>$TemplateConfig/Description$</Description>
</DisplayString>
<DisplayString ElementID="$TemplateConfig/ID$.AlertMessage">
<Name>$TemplateConfig/AlertName$</Name>
<Description>$TemplateConfig/AlertDescription$</Description>
</DisplayString>
</DisplayStrings>
</LanguagePack>
</LanguagePacks>
</Implementation>
</Template>