System.NetworkManagement.SnmpProbe

Applies To: System Center 2012 - Operations Manager, System Center 2012 R2 Operations Manager, System Center 2012 SP1 - Operations Manager

The System.NetworkManagement.SnmpProbe probe action module type is used to perform SNMP GET, GET-NEXT and SET actions and returns a System.SnmpData data type.

Usage

Use this module to either receive or write SNMP data within a workflow such as a rule or monitor. Usually, you’ll want to use System.NetworkManagement.SnmpEventDataSource or System.NetworkManagement.SnmpPerformanceDataSource to provide SNMP data in the form of event data or performance data, but this module can be useful in more general situations.

Type Definition

<ProbeActionModuleType ID="System.NetworkManagement.SnmpProbe" Accessibility="Public" Batching="false" PassThrough="false">
  <Configuration>
    <IncludeSchemaTypes>
      <SchemaType>Snmp!System.SnmpVarBindsSchema</SchemaType>
    </IncludeSchemaTypes>
    <xsd:element minOccurs="0" maxOccurs="1" name="Walk" type="xsd:boolean" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element minOccurs="0" maxOccurs="1" name="WalkReturnMultipleItems" type="xsd:boolean" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element minOccurs="0" maxOccurs="1" name="NoOfRetries" type="xsd:unsignedInt" default="3" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Timeout" type="xsd:unsignedInt" default="500" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element minOccurs="0" maxOccurs="1" name="Port" type="xsd:unsignedInt" default="161" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element minOccurs="0" maxOccurs="1" name="SNMPv3UserName" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element minOccurs="0" maxOccurs="1" name="SNMPv3AuthProtocol" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element minOccurs="0" maxOccurs="1" name="SNMPv3AuthPassword" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element minOccurs="0" maxOccurs="1" name="SNMPv3PrivProtocol" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element minOccurs="0" maxOccurs="1" name="SNMPv3PrivPassword" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element minOccurs="0" maxOccurs="1" name="SNMPv3ContextName" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="IsWriteAction" type="xsd:boolean" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="IP" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="CommunityString" type="xsd:string" 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 name="SnmpVarBinds" type="SnmpVarBindsType" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element minOccurs="0" maxOccurs="1" name="CodePage" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element minOccurs="0" maxOccurs="1" name="OutputOnError" type="xsd:boolean" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
  </Configuration>
  <ModuleImplementation Isolation="Any">
    <Native>
      <ClassID>2B72C326-CDBB-421a-ACC3-A1994DBD52BB</ClassID>
    </Native>
  </ModuleImplementation>
  <OutputType>Snmp!System.SnmpData</OutputType>
  <InputType>System!System.BaseData</InputType>
</ProbeActionModuleType>

Parameters

The System.SnmpProbe module supports the following configuration parameters:

Parameter Type Description

Walk

Boolean

Optional parameter. Specifies whether to walk or perform a GET-NEXT action on the SNMP MIB.

WalkReturnMultipleItems

Boolean

Optional parameter. Specifies whether to return separate System.SnmpData objects for each traversed SNMP MIB OID.

NoOfRetries

Integer

Optional parameter. The number of times that an SNMP GET operation will retry if it times out. Defaults to 3

Timeout

Integer

Optional parameter. The amount of time (in milliseconds) before an SNMP GET operation times out. Defaults to 500.

Port

Integer

Optional parameter. Specifies the port to use on the SNMP managed entity. Defaults to 161.

SNMPv3UserName

String

Optional parameter. Specifies the port to use on the SNMP managed entity. Defaults to 161.

SNMPv3EngineID

String

Optional parameter. Specifies the SNMPv3 user name, if one is used.

SNMPv3AuthProtocol

String

Optional parameter. Specifies the SNMPv3 authorization protocol, if one is used.

SNMPv3AuthPassword

String

Optional parameter. Specifies the SNMPv3 authorization password, if one is used.

SNMPv3PrivProtocol

String

Optional parameter. Specifies the SNMPv3 privacy protocol, if one is used.

SNMPv3PrivPassword

String

Optional parameter. Specifies the SNMPv3 privacy password, if one is used.

SNMPv3ContextName

String

Optional parameter. Specifies the SNMPv3 context name, if one is used.

IsWriteAction

Boolean

Specifies whether the current operation on the SNMP MIB is a write action. When set to true, the module is configured to perform a SET operation on the SNMP MIB. When false, the module is intended to perform either a GET or GET-NEXT operation.

IP

String

Specifies the IP address of the SNMP managed entity.

CommunityString

String

Contains the SNMP Community.

Version

String

Optional parameter. Specifies the SNMP version. To perform an SNMP v1 transaction, the value must be “1”.

SnmpVarBinds

Complex

Contains a list of SNMP variable bindings as SnmpVarBind elements. If the Walk parameter is true, only one SnmpVarBind must be specified.

CodePage

String

Optional parameter. Contains the numeric value for the performance value.

OutputOnError

Boolean

Optional parameter. Indicates whether the workflow should continue if the device returns an error.

Walk

When set to true, the System.SnmpProbe module is configured to walk the SNMP MIB in a GET-NEXT request. The SnmpVarBinds list must contain only one SnmpVarBind element from which to begin the walk. When set to false, the module is intended to perform a GET or SET operation on specified SNMP MIB variables.

<Walk>true</Walk>

WalkReturnMultipleItems

When set to true, the probe module will return each traversed OID instance in a separate System.SnmpData object. This allows the management server to create separate entities for each discovered instance. When set to false, the probe module returns a single System.SnmpData object. This parameter is used only when the Walk parameter is set to true.

<WalkReturnMultipleItems>true</WalkReturnMultipleItems>

IP

This is the IP address of the SNMP MIB.

<IP>$Target/Property[Type="System.NetworkManagement.Library!System.NetworkManagement.Node"]/IPAddress$</IP>

CommunityString

In Operations Manager 2012, the community string is not a property of the Target object. Instead, the community string comes from the RunAs Account associated with the workflow.

<CommunityString>$RunAs[Name=”NetworkLibrary!System.NetworkManagement.Snmp.MonitoringAccount”]/CommunityString$</CommunityString>

SnmpVarBinds

The SnmpVarBinds element contains an SMTP variable binding list. Each variable binding in the list is represented as an SnmpVarBind element. The SnmpVarBind element contains the following sub elements:

Element

Type

Description

OID

String

Specifies the SNMP OID of the entity in the SNMP MIB table.

Value

String

The value and variable type of OID entity. The variable type can be specified in the optional VariantType property. The value of the Value element is set only when the IsWriteAction parameter is set to true and a SET action is to be performed.

The following table maps SNMP data types to VariantType strings:

 

SNMP MIB type VariantType Value Variant Type

Integer, Counters, Gauges, TimeTicks (SNMPv1 and SNMPv2)

3

VT_I4

Octet strings, Object Identifiers, IP Addresses, Opaques, Network Addresses

8

VT_BSTR

Null

1

VT_NULL

Syntax

String

The Syntax property indicates the failure or success of the SNMP operation and can be inspected by a condition detection module in a workflow. If the operation is successful, the module sets the value of this property to the appropriate SNMP syntax data type.

Note

Note that for SET operations, the Syntax property must be set to one of the SNMP syntax data types.

The following table maps SNMP syntax data types to the appropriate string values.

 

Syntax data type String value

SNMP_SYNTAX_INT

2

SNMP_SYNTAX_INT32

2

SNMP_SYNTAX_BITS

3

SNMP_SYNTAX_OCTETS

4

SNMP_SYNTAX_NULL

5

SNMP_SYNTAX_OID

6

SNMP_SYNTAX_NSAPADDR

8

SNMP_SYNTAX_SEQUENCE

48

SNMP_SYNTAX_IPADDR

64

SNMP_SYNTAX_CNTR32

65

SNMP_SYNTAX_GUAGE32

66

SNMP_SYNTAX_TIMETICKS

67

SNMP_SYNTAX_OPAQUE

68

SNMP_SYNTAX_NSAPADDR

69

SNMP_SYNTAX_CENTR64

70

SNMP_SYNTAX_UINT32

71

The following table maps SNMP error syntax data types to the appropriate string values.

 

Error syntax data type String value

SNMP_SYNTAX_NOSUCHOBJECT

128

SNMP_SYNTAX_NOSUCHINSTANCE

129

SNMP_SYNTAX_ENDOFMIBVIEW

130

For more information, see RFC 1902, "Structure of Management Information for Version 2 of the Simple Network Management Protocol (SNMPv2)."

The following examples demonstrate the appropriate syntax for defining SnmpVarBind elements for both SET and GET actions.

In the following sample code, an SnmpVarBind element is defined for a probe that is to perform a GET action on the sysDescr MIB element.

 

<SnmpVarBind>
   <OID>1.3.6.1.2.1.1.0</OID>
   <Syntax>0</Syntax>
   <Value VariantType=”8”/>
</SnmpVarBind>

In the following sample code, an SnmpVarBind element is defined for a probe that is to perform a SET action on the sysName MIB element.

Composition

The System.NetworkManagement.SnmpProbe module is a native module.

The System.NetworkManagement.SnmpProbe 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.SnmpProbe module.

Exception Reason

11001

An SNMP GET message failed.

11002

An SNMP SET message failed.

11004

The module failed to retrieve PDU data.

11006

The module was unable to initialize the SNMP session.

Module Type Usage

External Module References

The System.SnmpProbe module is a member of the following modules:

Module Type Library Usage

System.NetworkManagement.SnmpGetProbe

System.Snmp.Monitoring

Internal module for Microsoft use only.

Sample

The following sample unit monitor illustrates how you can use the System.NetworkManagement.SnmpProbe to monitor for two single events on the same SNMP node.

<UnitMonitorType ID="System.NetworkManagement.SnmpProbe.2SingleEvent2StateMonitorType" Accessibility="Public">
  <MonitorTypeStates>
    <MonitorTypeState ID="FirstEventRaised" NoDetection="false" />
    <MonitorTypeState ID="SecondEventRaised" NoDetection="false" />
  </MonitorTypeStates>
  <Configuration>
    <IncludeSchemaTypes>
      <SchemaType>System!System.ExpressionEvaluatorSchema</SchemaType>
      <SchemaType>Snmp!System.SnmpVarBindsSchema</SchemaType>
    </IncludeSchemaTypes>
    <xsd:element name="FirstInterval" type="xsd:integer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="FirstIP" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element minOccurs="0" maxOccurs="1" name="FirstVersion" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="FirstSnmpVarBinds" type="SnmpVarBindsType" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="FirstExpression" type="ExpressionType" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="SecondInterval" type="xsd:integer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="SecondIP" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element minOccurs="0" maxOccurs="1" name="SecondVersion" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="SecondSnmpVarBinds" type="SnmpVarBindsType" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="SecondExpression" type="ExpressionType" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="NoOfRetries" type="xsd:unsignedInt" default="3" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="Timeout " type="xsd:unsignedInt" default="500" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    <xsd:element name="Port" type="xsd:unsignedInt" default="161" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
  </Configuration>
  <OverrideableParameters>
    <OverrideableParameter ID="FirstInterval" Selector="$Config/FirstInterval$" ParameterType="int" />
    <OverrideableParameter ID="SecondInterval" Selector="$Config/SecondInterval$" ParameterType="int" />
    <OverrideableParameter ID="NoOfRetries" Selector="$Config/NoOfRetries$" ParameterType="int" />
    <OverrideableParameter ID="Timeout" Selector="$Config/Timeout$" ParameterType="int" />
    <OverrideableParameter ID="Port" Selector="$Config/Port$" ParameterType="int" />
  </OverrideableParameters>
  <MonitorImplementation>
    <MemberModules>
      <DataSource ID="FirstDataSource" TypeID="System.NetworkManagement.SnmpDataSource">
        <Scheduler>
          <SimpleReccuringSchedule>
            <Interval Unit="Seconds">$Config/FirstInterval$</Interval>
          </SimpleReccuringSchedule>
          <ExcludeDates />
        </Scheduler>
        <NoOfRetries>$Config/NoOfRetries$</NoOfRetries>
        <Timeout>$Config/Timeout$</Timeout>
        <Port>$Config/Port$</Port>
        <IP>$Config/FirstIP$</IP>
        <CommunityString>$RunAs[Name="System.NetworkManagement.Snmp.MonitoringAccount"]/CommunityString$</CommunityString>
        <Version>$Config/FirstVersion$</Version>
        <SnmpVarBinds>$Config/FirstSnmpVarBinds$</SnmpVarBinds>
      </DataSource>
      <DataSource ID="SecondDataSource" TypeID="System.NetworkManagement.SnmpDataSource">
        <Scheduler>
          <SimpleReccuringSchedule>
            <Interval Unit="Seconds">$Config/SecondInterval$</Interval>
          </SimpleReccuringSchedule>
          <ExcludeDates />
        </Scheduler>
        <NoOfRetries>$Config/NoOfRetries$</NoOfRetries>
        <Timeout>$Config/Timeout$</Timeout>
        <Port>$Config/Port$</Port>
        <IP>$Config/SecondIP$</IP>
        <CommunityString>$RunAs[Name="System.NetworkManagement.Snmp.MonitoringAccount"]/CommunityString$</CommunityString>
        <Version>$Config/SecondVersion$</Version>
        <SnmpVarBinds>$Config/SecondSnmpVarBinds$</SnmpVarBinds>
      </DataSource>
      <ConditionDetection ID="FirstFilterCondition" TypeID="System!System.ExpressionFilter">
        <Expression>$Config/FirstExpression$</Expression>
      </ConditionDetection>
      <ConditionDetection ID="SecondFilterCondition" TypeID="System!System.ExpressionFilter">
        <Expression>$Config/SecondExpression$</Expression>
      </ConditionDetection>
    </MemberModules>
    <RegularDetections>
      <RegularDetection MonitorTypeStateID="FirstEventRaised">
        <Node ID="FirstFilterCondition">
          <Node ID="FirstDataSource" />
        </Node>
      </RegularDetection>
      <RegularDetection MonitorTypeStateID="SecondEventRaised">
        <Node ID="SecondFilterCondition">
          <Node ID="SecondDataSource" />
        </Node>
      </RegularDetection>
    </RegularDetections>
  </MonitorImplementation>
</UnitMonitorType>

Information

   

Module Type

ProbeActionModuleType

Input Type

System.BaseData

Output Type

System.SnmpData

Implementation

Native

Library

System.Snmp.Library