System.SnmpTrapProvider
Applies To: System Center 2012 - Operations Manager, System Center 2012 R2 Operations Manager, System Center 2012 SP1 - Operations Manager
The System.SnmpTrapProvider data source module type is used to return SNMP traps as a System.SnmpData data type.
Warning
The System.SnmpTrapProvider module is included in System Center Operations Manager 2012 for backward compatibility only. Its functionality has been superseded by the System.NetworkManagement.SnmpTrapProvider module.
Usage
Use this module to either receive SNMP trap events from within a workflow such as a rule or monitor.
Type Definition
<DataSourceModuleType ID="System.SnmpTrapProvider" Accessibility="Public" Batching="false">
<Configuration>
<xsd:element minOccurs="1" maxOccurs="1" name="IP" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" maxOccurs="1" name="CommunityString" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="1" maxOccurs="1" name="AllTraps" type="xsd:boolean" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="0" maxOccurs="1" name="Version" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element minOccurs="0" maxOccurs="1" name="OIDProps" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="OIDProp" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</Configuration>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="DS" TypeID="System.SnmpTrapProvider.Internal">
<IP>$Config/IP$</IP>
<CommunityString>$Config/CommunityString$</CommunityString>
<AllTraps>$Config/AllTraps$</AllTraps>
<Version>$Config/Version$</Version>
<OIDProps>$Config/OIDProps$</OIDProps>
<BackCompatMode>true</BackCompatMode>
</DataSource>
</MemberModules>
<Composition>
<Node ID="DS" />
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System.SnmpData</OutputType>
</DataSourceModuleType>
Parameters
The System.SnmpTrapProvider module supports the following configuration parameters:
Parameter | Type | Description |
---|---|---|
IP |
String |
Specifies the IP address of the SNMP managed entity from which the traps originate. |
CommunityString |
String |
Contains the SNMP Community String. |
AllTraps |
Boolean |
Specifies whether all traps from the target device should be sent to Operations Manager. |
Version |
String |
Optional. Specifies the SNMP version. The default value is “2”. To perform an SNMP v1 transaction, the value must be “1”. |
OIDProps |
Complex |
Contains a list of OIDs to register for traps when AllTraps is set to false. |
AllTraps
When set to true, the System.SnmpTrap.EventProvider module is configured to send all traps from the targeted device to Operations Manager. When it is set to false, an OIDProps element with at least one OIDProp element must be provided.
<AllTraps>true</AllTraps>
OIDProps
Contains a list of at least one OIDProp element. Each OIDProp element represents an OID that traps from the targeted device will contain. If AllTraps is set to true, this element is not necessary. It should be noted that if this element does contain at least one OIDProp element, AllTraps will be ignored.
<OIDProps>
<OIDProp>1.3.6.1.2.1.4.1.0</OIDProp>
</OIDProps>
Composition
The System.SnmpTrapProvider module is a native module.
The System.SnmpTrapProvider module wraps portions of the WinSNMP API. For a deeper understanding of how the module works internally, see the WinSNMP API topic.
Errors
The following errors can occur from within the System.SnmpTrapProvider module.
Exception | Reason |
---|---|
11001 |
An SNMP GET message failed. |
11002 |
An SNMP SET message failed. |
11003 |
An error occurred when receiving an SNMP message, and the received varbind status was not valid. |
11004 |
The module failed to retrieve PDU data. |
11006 |
The module was unable to initialize the SNMP session. |
Related Modules
Module Type | Usage |
---|---|
Performs SNMP GET actions in the context of an IP range. The module returns a System.SnmpData data type. |
|
Performs SNMP GET, GET-NEXT and SET actions and returns a System.SnmpData data type. |
External Module References
The System.SnmpTrapProvider module is a member of the following modules:
Module Type | Library | Usage |
---|---|---|
System.Snmp.Library |
Returns SNMP traps as a device specific System.Event.Data data type. |
Sample
The following example shows how you can set up a rule to receive an SNMP cold start trap from an SNMP network device. When the trap is received, an alert is generated.
<Rule ID="Microsoft.OM.Samples.Modules.SNMP.ColdStartTrapRule2" Enabled="true" Target="MicrosoftSystemCenterNetworkDeviceLibrary!Microsoft.SystemCenter.NetworkDevice" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>Custom</Category>
<DataSources>
<DataSource ID="trapprovider" TypeID="Snmp!System.SnmpTrapProvider">
<IP>$Target/Property[Type="NetworkDevice!Microsoft.SystemCenter.NetworkDevice"]/IPAddress$</IP>
<CommunityString>$Target/Property[Type="NetworkDevice!Microsoft.SystemCenter.NetworkDevice"]/CommunityString$</CommunityString>
<AllTraps>false</AllTraps>
<OIDProps>
<OIDProp>1.3.6.1.6.3.1.1.5.1</OIDProp>
</OIDProps>
</DataSource>
</DataSources>
<ConditionDetection ID="filter" TypeID="System!System.LogicalSet.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>ErrorCode</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>1</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<EmptySet>Passthrough</EmptySet>
<SetEvaluation>Any</SetEvaluation>
</ConditionDetection>
<WriteActions>
<WriteAction ID="alert" TypeID="Health!System.Health.GenerateAlert">
<Priority>0</Priority>
<Severity>0</Severity>
</WriteAction>
</WriteActions>
</Rule>
Information
Module Type |
|
Output Type |
|
Implementation |
Native |
Library |
System.Snmp.Library |