Discovering and monitoring SNMP tables [SNMP MP Chap 5] #scom #sysctr


It has been a while since I first wrote about SNMP monitoring with OpsMgr. In my last installment I left open the chance to build a more sophisticated module to better manage tables, since I didn’t receive many requests I left the chance on the table, until today. The bad guy that pushed me to go down this road is my fellow MVP Stanislav Zhelyazkov, we embarked in a project to monitor some Kemp devices. After all this time, I had to reread my post series especially regarding tables and it has been an unpleasant experience. Too complex and error prone.

So here I am announcing the QND.SNMP.Library (https://qndsnmp.codeplex.com/) downloadable on Technet Gallery. I published the project on Codeplex with the final goal to add more and more devices.

In this first release the library addresses SNMP tables discovering and monitoring, currently we have the following limitations:

          All the data is returned as String, numeric values are casted using the EN-US locale

          The SNMPv3 Context property is not used. This means SNMPv3 works perfectly until you have devices using Context property.

From http://tools.ietf.org/html/rfc5343

An SNMP context is a collection of management information accessible

by an SNMP entity.  An item of management information may exist in

more than one context and an SNMP entity potentially has access to

many contexts [RFC3411].  A context is identified by the snmpEngineID

value of the entity hosting the management information (also called a

contextEngineID) and a context name that identifies the specific

context (also called a contextName).

          The library has been tested with v2 and v3 devices

          The library currently supports simple tables (not nested ones)

The library uses an external SNMP engine for SNMP GET and WALK (https://sharpsnmplib.codeplex.com/) the management pack distributes the SharpSnmpLib.dll assembly.

The library exposes 3 modules:

          QND.SNMP.GetTable.DS – this data source returns a set of property bags with all the content of the table. Used in monitoring scenarios.

          QND.SNMP.TableDiscovery.DS – this is a filtered discovery provider to enumerate, filter and discover table entries

          QND.SNMP.GetTable.PT – this is the core module for table enumeration. It’s a public probe type that can be composed as you like

The official documentation for the modules is on the CodePlex project site. In this post I just want to show how the complex discovery and monitoring structure I detailed in https://nocentdocent.wordpress.com/2013/06/25/device-components-discovery-snmp-mp-chap-4-scom-sysctr/ is dramatically simplified with the module.

The three way discovery for disks can now be accomplished in just one step, and the monitoring part can now use cookdown walking the table just once instead of once for every disk.

Disk Discovery workflow in one step

<Discovery ID=Progel.LibraEsva.Disk.Discovery Enabled=true ConfirmDelivery=false Remotable=true Priority=Normal Target=Progel.LibraEsva.Device>

<Category>Discovery</Category>

<DiscoveryTypes>

   <DiscoveryClass TypeID=Progel.LibraEsva.Disk />

</DiscoveryTypes>

<DataSource ID=DS TypeID=Progel.LibraEsva.Disk.Discovery.MT>

   <IntervalSeconds>43200</IntervalSeconds>

   <SyncTime />

   <Timeout>3500</Timeout>

   <Port>$Target/Property[Type=”Network!System.NetworkManagement.Node”]/PortNumber$</Port>

   <IP>$Target/Property[Type=”Network!System.NetworkManagement.Node”]/SNMPAddress$</IP>           

<CommunityString>$RunAs[Name=”Network!System.NetworkManagement.Snmp.MonitoringAccount”]/CommunityString$$Target/Property[Type=”Network!System.NetworkManagement.Node”]/VirtualCommunitySuffix$</CommunityString>

   <Version>$Target/Property[Type=”Network!System.NetworkManagement.Node”]/SNMPVersion$</Version>

   <DeviceKey>$Target/Property[Type=”Network!System.NetworkManagement.Node”]/DeviceKey$</DeviceKey>

   <TraceLevel>2</TraceLevel>

   <ProbeTimeoutSeconds>300</ProbeTimeoutSeconds>

</DataSource>

</Discovery>

 

The data source module used by the discovery is based on QND.SNMP.TableDiscovery.DS where the bulk of the code is SNMP parameters copy and paste and data mapping to create the disk instances. As you can read the TableDiscovery DS implements a filter that can be natively used to filter out not needed instances, I highlighted the relevant code:

Disk discovery data source

      <DataSourceModuleType ID=Progel.LibraEsva.Disk.Discovery.MT Accessibility=Public Batching=false>

        <Configuration>

          <xsd:element minOccurs=1 name=IntervalSeconds type=xsd:integer />

          <xsd:element minOccurs=0 name=SyncTime type=xsd:string />

          <xsd:element minOccurs=0 maxOccurs=1 name=Timeout type=xsd:unsignedInt default=500 />

          <xsd:element minOccurs=0 maxOccurs=1 name=Port type=xsd:unsignedInt default=161 />

          <xsd:element name=IP type=xsd:string />

          <xsd:element name=CommunityString type=xsd:string />

          <xsd:element minOccurs=0 maxOccurs=1 name=Version type=xsd:string />

          <xsd:element minOccurs=1 name=DeviceKey type=xsd:string />

          <xsd:element minOccurs=0 name=TraceLevel type=xsd:integer default=2 xmlns:xsd=http://www.w3.org/2001/XMLSchema />

          <xsd:element minOccurs=0 name=ProbeTimeoutSeconds type=xsd:integer default=300 xmlns:xsd=http://www.w3.org/2001/XMLSchema />

        </Configuration>

        <OverrideableParameters>

          <OverrideableParameter ID=IntervalSeconds Selector=$Config/IntervalSeconds$ ParameterType=int />

          <OverrideableParameter ID=SyncTime Selector=$Config/SyncTime$ ParameterType=string />

          <OverrideableParameter ID=Timeout Selector=$Config/IntervalSeconds$ ParameterType=int />

          <OverrideableParameter ID=TraceLevel Selector=$Config/TraceLevel$ ParameterType=int />

          <OverrideableParameter ID=ProbeTimeoutSeconds Selector=$Config/ProbeTimeoutSeconds$ ParameterType=int />

        </OverrideableParameters>

        <ModuleImplementation Isolation=Any>

          <Composite>

            <MemberModules>

              <DataSource ID=GetDisks TypeID=QSNMP!QND.SNMP.TableDiscovery.DS>

                <NoOfRetries>3</NoOfRetries>

                <Timeout>$Config/Timeout$</Timeout>

                <Port>$Config/Port$</Port>

                <SNMPv3UserName>$RunAs[Name=”Network!System.NetworkManagement.SnmpV3.MonitoringAccount”]/UserName$</SNMPv3UserName>

                <SNMPv3AuthProtocol>$RunAs[Name=”Network!System.NetworkManagement.SnmpV3.MonitoringAccount”]/AuthenticationProtocol$</SNMPv3AuthProtocol>

                <SNMPv3AuthPassword>$RunAs[Name=”Network!System.NetworkManagement.SnmpV3.MonitoringAccount”]/AuthenticationKey$</SNMPv3AuthPassword>

                <SNMPv3PrivProtocol>$RunAs[Name=”Network!System.NetworkManagement.SnmpV3.MonitoringAccount”]/PrivacyProtocol$</SNMPv3PrivProtocol>

                <SNMPv3PrivPassword>$RunAs[Name=”Network!System.NetworkManagement.SnmpV3.MonitoringAccount”]/PrivacyKey$</SNMPv3PrivPassword>

                <SNMPv3ContextName>$RunAs[Name=”Network!System.NetworkManagement.SnmpV3.MonitoringAccount”]/ContextName$</SNMPv3ContextName>

                <IP>$Config/IP$</IP>

                <CommunityString>$Config/CommunityString$</CommunityString>

                <Version>$Config/Version$</Version>

                <TableOID>.1.3.6.1.2.1.25.2.3.1</TableOID> This is the table starting OID

                <TableIndex>1</TableIndex> This is the table entry OID for the index i.e. TableOID.TableIndex

                <TraceLevel>$Config/TraceLevel$</TraceLevel>

                <ScriptTimeoutSeconds>$Config/ProbeTimeoutSeconds$</ScriptTimeoutSeconds>

                <IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>

                <SyncTime>$Config/SyncTime$</SyncTime>

                <Filter> Here we filter for disks only

                  <SimpleExpression>

                    <ValueExpression>

                      <XPathQuery Type=String>Property[@Name=’.1.3.6.1.2.1.25.2.3.1.2′]</XPathQuery>

                    </ValueExpression>

                    <Operator>Equal</Operator>

                    <ValueExpression>

                      <Value>.1.3.6.1.2.1.25.2.1.4</Value>

                    </ValueExpression>

                  </SimpleExpression>

                </Filter>

                <ClassId>$MPElement[Name=’Progel.LibraEsva.Disk’]$</ClassId>

                <InstanceSettings> From here on we’re just mapping the returned property bags to the proper fields

                  <Settings>

                    <Setting>

                      <Name>$MPElement[Name=’Network!System.NetworkManagement.Node’]/DeviceKey$</Name>

                      <Value>$Config/DeviceKey$</Value>

                    </Setting>

                    <Setting>

                      <Name>$MPElement[Name=’Network!System.NetworkManagement.LogicalDevice’]/Key$</Name>

                      <Value>Disk-.1.3.6.1.2.1.25.2.3.1.1.$Data/Property[@Name=’Index’]$</Value>

                    </Setting>

                    <Setting>

                      <Name>$MPElement[Name=’Network!System.NetworkManagement.Disk’]/Removable$</Name>

                      <Value>false</Value>

                    </Setting>

                    <Setting>

                      <Name>$MPElement[Name=’Network!System.NetworkManagement.LogicalDevice’]/Index$</Name>

                      <Value>$Data/Property[@Name=”Index”]$</Value>

                    </Setting>

                    <Setting>

                      <Name>$MPElement[Name=’Network!System.NetworkManagement.LogicalDevice’]/Description$</Name>

                      <Value>$Data/Property[@Name=’.1.3.6.1.2.1.25.2.3.1.3′]$</Value>

                    </Setting>

                    <Setting>

                      <Name>$MPElement[Name=’System!System.Entity’]/DisplayName$</Name>

                      <Value>Disk – $Data/Property[@Name=’.1.3.6.1.2.1.25.2.3.1.3′]$</Value>

                    </Setting>

                    <Setting>

                      <Name>$MPElement[Name=’Network!System.NetworkManagement.Disk’]/Capacity$</Name>

                      <Value>$Data/Property[@Name=’.1.3.6.1.2.1.25.2.3.1.5′]$</Value>

                    </Setting>

                    <Setting>

                      <Name>$MPElement[Name=’Progel.LibraEsva.Disk’]/AllocationUnitSize$</Name>

                      <Value>$Data/Property[@Name=’.1.3.6.1.2.1.25.2.3.1.4′]$</Value>

                    </Setting>

                  </Settings>

                </InstanceSettings>

              </DataSource>

            </MemberModules>

            <Composition>

              <Node ID=GetDisks />

            </Composition>

          </Composite>

        </ModuleImplementation>

        <OutputType>System!System.Discovery.Data</OutputType>

      </DataSourceModuleType>

 

The new disk monitor uses QND.SNMP.GetTable.DS as its data source, the data source doesn’t have the device index in its parameters so it can be cooked down by the HealthService logic, the monitor can then filter just the property bag instance needed and do all the math that it needs. Again the peculiarities are highlighted in the code.

Disk free space Unit Monitor Type

<UnitMonitorType ID=Progel.LibraEsva.DiskFreeSpace.MT Accessibility=Internal>

<MonitorTypeStates>

  <MonitorTypeState ID=AboveThreshold NoDetection=false />

  <MonitorTypeState ID=UnderThreshold NoDetection=false />

</MonitorTypeStates>

<Configuration>

  <xsd:element minOccurs=1 name=IntervalSeconds type=xsd:integer xmlns:xsd=http://www.w3.org/2001/XMLSchema />

  <xsd:element minOccurs=0 name=SyncTime type=xsd:string 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 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 minOccurs=1 name=LogicalDeviceIndex type=xsd:string xmlns:xsd=http://www.w3.org/2001/XMLSchema />

  <xsd:element minOccurs=1 name=Threshold type=xsd:integer xmlns:xsd=http://www.w3.org/2001/XMLSchema />

  <xsd:element minOccurs=1 name=NumberOfSamples type=xsd:integer xmlns:xsd=http://www.w3.org/2001/XMLSchema />

  <xsd:element minOccurs=0 name=TraceLevel type=xsd:integer default=2 xmlns:xsd=http://www.w3.org/2001/XMLSchema />

  <xsd:element minOccurs=0 name=ProbeTimeoutSeconds type=xsd:integer default=300 xmlns:xsd=http://www.w3.org/2001/XMLSchema />

</Configuration>

<OverrideableParameters>

  <OverrideableParameter ID=IntervalSeconds Selector=$Config/IntervalSeconds$ ParameterType=int />

  <OverrideableParameter ID=SyncTime Selector=$Config/SyncTime$ ParameterType=string />

  <OverrideableParameter ID=Timeout Selector=$Config/IntervalSeconds$ ParameterType=int />

  <OverrideableParameter ID=Threshold Selector=$Config/Threshold$ ParameterType=int />

  <OverrideableParameter ID=NumberOfSamples Selector=$Config/NumberOfSamples$ ParameterType=int />

  <OverrideableParameter ID=TraceLevel Selector=$Config/TraceLevel$ ParameterType=int />

  <OverrideableParameter ID=ProbeTimeoutSeconds Selector=$Config/ProbeTimeoutSeconds$ ParameterType=int />

</OverrideableParameters>

<MonitorImplementation>

  <MemberModules>

    <DataSource ID=DS TypeID=QSNMP!QND.SNMP.GetTable.DS>

      <NoOfRetries>3</NoOfRetries>

      <Timeout>$Config/Timeout$</Timeout>

      <Port>$Config/Port$</Port>

      <SNMPv3UserName>$RunAs[Name=”Network!System.NetworkManagement.SnmpV3.MonitoringAccount”]/UserName$</SNMPv3UserName>

      <SNMPv3AuthProtocol>$RunAs[Name=”Network!System.NetworkManagement.SnmpV3.MonitoringAccount”]/AuthenticationProtocol$</SNMPv3AuthProtocol>

      <SNMPv3AuthPassword>$RunAs[Name=”Network!System.NetworkManagement.SnmpV3.MonitoringAccount”]/AuthenticationKey$</SNMPv3AuthPassword>

      <SNMPv3PrivProtocol>$RunAs[Name=”Network!System.NetworkManagement.SnmpV3.MonitoringAccount”]/PrivacyProtocol$</SNMPv3PrivProtocol>

      <SNMPv3PrivPassword>$RunAs[Name=”Network!System.NetworkManagement.SnmpV3.MonitoringAccount”]/PrivacyKey$</SNMPv3PrivPassword>

      <SNMPv3ContextName>$RunAs[Name=”Network!System.NetworkManagement.SnmpV3.MonitoringAccount”]/ContextName$</SNMPv3ContextName>

      <IP>$Config/IP$</IP>

      <CommunityString>$Config/CommunityString$</CommunityString>

      <Version>$Config/Version$</Version>

      <TableOID>.1.3.6.1.2.1.25.2.3.1</TableOID> Tabel entry point and Index dimension

      <TableIndex>1</TableIndex>

      <TraceLevel>$Config/TraceLevel$</TraceLevel>

      <ScriptTimeoutSeconds>$Config/ProbeTimeoutSeconds$</ScriptTimeoutSeconds>

      <IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>

      <SyncTime>$Config/SyncTime$</SyncTime>

    </DataSource>

    <ConditionDetection ID=FilterIndex TypeID=System!System.ExpressionFilter> Condition detection to get just the needed property bag

      <Expression>

        <SimpleExpression>

          <ValueExpression>

            <XPathQuery Type=String>Property[@Name=’Index’]</XPathQuery>

          </ValueExpression>

          <Operator>Equal</Operator>

          <ValueExpression>

            <Value>$Config/LogicalDeviceIndex$</Value>

          </ValueExpression>

        </SimpleExpression>

      </Expression>

    </ConditionDetection>

 

Hope this new module can ease SNMP monitoring MPs.

Let me know.

  • Daniele This posting is provided “AS IS” with no warranties, and confers no rights.
Advertisements
  1. #1 by Steve on May 23, 2016 - 10:31 pm

    Daniele, geat job! I would like to change the Filter on the Table2Bag.Filtered.Discovery.DS for network adapters, I need to key off a substring comparison for the Description field but the filter operator doesn’t seem to like anything but Equal. What am I doing wrong. this is what works:

    Property[@Name=”.1.3.6.1.2.1.2.2.1.7″]

    Equal

    1

    What I would like is:

    Property[@Name=”.1.3.6.1.2.1.2.2.1.2″]

    Contains

    “eth”

    thanks for all your hard work!

  2. #3 by hectormarcia on April 22, 2016 - 8:17 pm

    Hi Daniele,

    Never mind. All I need is in chapter 4.

    Thanks

  3. #4 by hectormarcia on April 22, 2016 - 6:43 pm

    Hi Daniele,

    Great work. Thank you.

    I’m with you up until the device discovery and Disk discovery. The Progel.LibraEsva.DiskFreeSpace.MT produces the following error in VSAE:

    “The element ‘MonitorImplementation’ has incomplete content. List of possible elements expected: ‘RegularDetections'”

    how to I go about adding Regular Detention values for this MT?

    ALso, how does a unit monitor base on this MT would look like?

    thanks Daniele

  4. #5 by Peter Svensson on January 14, 2016 - 10:41 am

    Hi!

    We are using your Kemp Management Pack as an example for monitoring a similar device “Loadbalancer.org”. Much is similar like processor and memory (using the same OID). We are having problems though with the Discovery of the Virtual and Real Servers. How can you find out the SNMP tables of the device? How did you go about with the Kemp device?

    • #6 by Daniele Grandini on January 25, 2016 - 3:40 pm

      Hi Peter,
      if you have the MIB files for the device it should be fairly simple. For Kemp (and other devices) I used the MIB files and an SNMP complete walk to better understand what actual values in that tables.

      • #7 by Peter Svensson on January 27, 2016 - 6:34 am

        Hi

        Thanks for the reply.

        After digging into this more we think this error may be the cause of why we are not getting the Virtual/Real Servers objects into SCOM.

        In the OpsMgr Eventlog of the Management Server doing the network Discovery:
        QND-Translate-SnmpTable : Main Cannot convert argument “1”, with value: “SCRIPT_STATUS”, for “LogScriptEvent” to type “System.UInt16”: “Cannot convert value “SCRIPT_STATUS” to type “System.UInt16”. Error: “Input string was not in a correct format.”

        It seems “someone” has made an update of the ps1 file doing the translation. Tthe status of the patch is “Being evaluated”
        https://qndsnmp.codeplex.com/SourceControl/list/patches

        Since its a sealed MP we cant test it. We are more then willing to try if this solves our problem, Do you know if the patch is going to be implemented?

      • #8 by Daniele Grandini on January 29, 2016 - 11:36 am

        Hi Peter, I must definitely implement a patch, it is a simple one, but now I have all my dev tools targeted at GitHub, so I must first port the project to GitHub. I found an offline version .106. If you want to give it a try I uploaded it on COdePlex.
        At the moment I don’t have a date for the patch.

      • #9 by Peter Svensson on January 29, 2016 - 12:57 pm

        Hi

        I tried the beta MP. Still the same issue.
        I appreciate the hard work you are doing. Thanx for your effort.

      • #10 by Daniele Grandini on February 5, 2016 - 12:14 pm

        Fixed the issue, now you’ll get the true error in eventlog with eventid 833, from there you can start tshoot what’s wrong with table discovery. Let me know.

      • #11 by Peter on February 8, 2016 - 8:47 am

        Hi

        Yes, now it works. I can see that is outputting 833 events. Thank you.

      • #12 by Daniele Grandini on February 13, 2016 - 10:43 am

        and what are those events stating, cause if everything is ok you shouldn’t see any 833 event.

      • #13 by Peter on February 15, 2016 - 10:24 am

        Hi

        It states the following. And there are a number of these entrys. We have tried different “starting” OIDs for the table but we don’t get any results back.
        QND-Translate-SnmpTable : The .1.3.6.1.4.1.8225.4711.18.1.16.22.2 doesn’t belong to the table .1.3.6.1.4.1.8225.4711.17.1
        Version :1.0

        I can send you the MIB files if you want to.

      • #14 by Daniele Grandini on February 29, 2016 - 7:26 am

        Hi Peter, sorry for the late reply, I missed your comment. It seems something odd is going on with the monitor parameters. Which is the base OID of the snmp table? Rather than a MIB it’s way better a snmp walk.

      • #15 by Peter on February 29, 2016 - 2:02 pm

        Hi!

        We Believe the base-class is for the Virtual Servers (just like Kemp) is
        1.3.6.1.4.1.8225.4711.17.1

        And the Real Servers are:
        1.3.6.1.4.1.29385.106.1.2.18

        SNMP Walk
        ———————– New Test ———————–
        Paessler SNMP Tester 5.1.3
        2016-02-29 13:56:01 (1 ms) : Device: lb-got
        2016-02-29 13:56:01 (4 ms) : SNMP V2c
        2016-02-29 13:56:01 (5 ms) : Uptime
        2016-02-29 13:56:01 (22 ms) : ——-
        2016-02-29 13:56:01 (22 ms) : DISMAN-EVENT-MIB::sysUpTimeInstance = 656535344 ( 75 days )
        2016-02-29 13:56:01 (26 ms) : HOST-RESOURCES-MIB::hrSystemUptime.0 = 947214427 ( 109 days )
        2016-02-29 13:56:01 (27 ms) : Done

        ———————– New Test ———————–
        Paessler SNMP Tester 5.1.3
        2016-02-29 13:56:19 (3 ms) : Device: lb-got
        2016-02-29 13:56:19 (4 ms) : SNMP V2c
        2016-02-29 13:56:19 (5 ms) : Walk 1.3.6.1.4.1.29385.106.1.2.17
        2016-02-29 13:56:19 (9 ms) : 1.3.6.1.4.1.29385.106.1.2.17.2.1 = “no check”
        2016-02-29 13:56:19 (13 ms) : 1.3.6.1.4.1.29385.106.1.2.17.2.2 = “UP”
        2016-02-29 13:56:19 (16 ms) : 1.3.6.1.4.1.29385.106.1.2.17.2.3 = “UP”
        2016-02-29 13:56:19 (19 ms) : 1.3.6.1.4.1.29385.106.1.2.17.3.1 = “no check”
        2016-02-29 13:56:19 (22 ms) : 1.3.6.1.4.1.29385.106.1.2.17.3.2 = “UP”
        2016-02-29 13:56:19 (25 ms) : 1.3.6.1.4.1.29385.106.1.2.17.3.3 = “UP”
        2016-02-29 13:56:19 (30 ms) : 1.3.6.1.4.1.29385.106.1.2.17.3.4 = “UP”
        2016-02-29 13:56:19 (34 ms) : 1.3.6.1.4.1.29385.106.1.2.17.3.5 = “UP”
        2016-02-29 13:56:19 (38 ms) : 1.3.6.1.4.1.29385.106.1.2.17.3.6 = “UP”
        2016-02-29 13:56:19 (42 ms) : 1.3.6.1.4.1.29385.106.1.2.17.4.1 = “no check”
        2016-02-29 13:56:19 (49 ms) : 1.3.6.1.4.1.29385.106.1.2.17.4.2 = “UP”
        2016-02-29 13:56:19 (54 ms) : 1.3.6.1.4.1.29385.106.1.2.17.4.3 = “UP”
        2016-02-29 13:56:19 (59 ms) : 1.3.6.1.4.1.29385.106.1.2.17.4.4 = “UP”
        2016-02-29 13:56:19 (65 ms) : 1.3.6.1.4.1.29385.106.1.2.17.4.5 = “UP”
        2016-02-29 13:56:19 (69 ms) : 1.3.6.1.4.1.29385.106.1.2.17.4.6 = “UP”

        ———————– New Test ———————–
        Paessler SNMP Tester 5.1.3
        2016-02-29 13:59:02 (6 ms) : Device: lb-got
        2016-02-29 13:59:02 (8 ms) : SNMP V2c
        2016-02-29 13:59:02 (12 ms) : Walk 1.3.6.1.4.1.29385.106.1.2.18
        2016-02-29 13:59:02 (23 ms) : 1.3.6.1.4.1.29385.106.1.2.18.2.1 = “1”
        2016-02-29 13:59:02 (30 ms) : 1.3.6.1.4.1.29385.106.1.2.18.2.2 = “1”
        2016-02-29 13:59:02 (42 ms) : 1.3.6.1.4.1.29385.106.1.2.18.2.3 = “1”
        2016-02-29 13:59:02 (52 ms) : 1.3.6.1.4.1.29385.106.1.2.18.3.1 = “1”
        2016-02-29 13:59:02 (63 ms) : 1.3.6.1.4.1.29385.106.1.2.18.3.2 = “1”
        2016-02-29 13:59:02 (73 ms) : 1.3.6.1.4.1.29385.106.1.2.18.3.3 = “1”
        2016-02-29 13:59:02 (80 ms) : 1.3.6.1.4.1.29385.106.1.2.18.3.4 = “1”
        2016-02-29 13:59:02 (89 ms) : 1.3.6.1.4.1.29385.106.1.2.18.3.5 = “1”
        2016-02-29 13:59:02 (97 ms) : 1.3.6.1.4.1.29385.106.1.2.18.3.6 = “1”
        2016-02-29 13:59:02 (106 ms) : 1.3.6.1.4.1.29385.106.1.2.18.4.1 = “1”
        2016-02-29 13:59:02 (114 ms) : 1.3.6.1.4.1.29385.106.1.2.18.4.2 = “1”
        2016-02-29 13:59:02 (122 ms) : 1.3.6.1.4.1.29385.106.1.2.18.4.3 = “1”
        2016-02-29 13:59:02 (131 ms) : 1.3.6.1.4.1.29385.106.1.2.18.4.4 = “1”
        2016-02-29 13:59:02 (142 ms) : 1.3.6.1.4.1.29385.106.1.2.18.4.5 = “1”
        2016-02-29 13:59:02 (150 ms) : 1.3.6.1.4.1.29385.106.1.2.18.4.6 = “1”

      • #16 by Daniele Grandini on March 16, 2016 - 6:47 pm

        Sorry Peter, I have a little back log on comments. From what I can see you have two tables here 1.3.6.1.4.1.29385.106.1.2.17 and 1.3.6.1.4.1.29385.106.1.2.18, which is the base OID and index dimension you configured for the monitor/discovery? You should have two different discoveries with seed …2.17 and …2.18. Strange thing I don’t see the 1 index but, by heart, the discovery should work anyway.

  5. #17 by jvjean on September 10, 2014 - 2:36 pm

    Link to the technet download is broken.
    You can find the library here : http://gallery.technet.microsoft.com/QND-SNMP-Library-scom-5ec7ebd0

    • #18 by Peter on March 17, 2016 - 2:42 pm

      Hi

      For Virtual Servers
      .1.3.6.1.4.1.8225.4711.17.1
      .1.3.6.1.4.1.8225.4711.17.1.1

      And Real Servers
      .1.3.6.1.4.1.8225.4711.18.1.1
      .1.3.6.1.4.1.8225.4711.18.1.1

      Looks like this for Virtual Servers. Not sure If I got correct base OID and index

      Discovery

      43200

      3
      $Target/Property[Type=”Network!System.NetworkManagement.Node”]/PortNumber$
      $Target/Property[Type=”Network!System.NetworkManagement.Node”]/SNMPAddress$
      $RunAs[Name=”Network!System.NetworkManagement.Snmp.MonitoringAccount”]/CommunityString$$Target/Property[Type=”Network!System.NetworkManagement.Node”]/VirtualCommunitySuffix$
      $Target/Property[Type=”Network!System.NetworkManagement.Node”]/SNMPVersion$
      .1.3.6.1.4.1.8225.4711.17.1
      .1.3.6.1.4.1.8225.4711.17.1.1
      true
      4
      $MPElement[Name=’QND.Network.Kemp.LoadMaster.IPVS’]$

      $MPElement[Name=’Network!System.NetworkManagement.Node’]/DeviceKey$
      $Target/Property[Type=”Network!System.NetworkManagement.Node”]/DeviceKey$

      $MPElement[Name=’Network!System.NetworkManagement.LogicalDevice’]/Key$
      $Data/Property[@Name=”Index”]$

      $MPElement[Name=’Network!System.NetworkManagement.LogicalDevice’]/Index$
      $Data/Property[@Name=”Index”]$

      $MPElement[Name=’Network!System.NetworkManagement.LogicalDevice’]/Description$
      $Data/Property[@Name=”.1.3.6.1.4.1.8225.4711.17.1.1.13″]$

      $MPElement[Name=’System!System.Entity’]/DisplayName$
      $Data/Property[@Name=”.1.3.6.1.4.1.8225.4711.17.1.1.13″]$

      $MPElement[Name=’QND.Network.Kemp.LoadMaster.IPVS’]/IP$
      $Data/Property[@Name=”.1.3.6.1.4.1.8225.4711.17.1.1.2″]$

      $MPElement[Name=’QND.Network.Kemp.LoadMaster.IPVS’]/PortNumber$
      $Data/Property[@Name=”.1.3.6.1.4.1.8225.4711.17.1.1.5″]$

      $MPElement[Name=’QND.Network.Kemp.LoadMaster.IPVS’]/ProtocolId$
      $Data/Property[@Name=”.1.3.6.1.4.1.8225.4711.17.1.1.3″]$

      $MPElement[Name=’QND.Network.Kemp.LoadMaster.IPVS’]/VSAddrTypeId$
      $Data/Property[@Name=”.1.3.6.1.4.1.8225.4711.17.1.1.4″]$

      $MPElement[Name=’QND.Network.Kemp.LoadMaster.IPVS’]/VSschedulingMethod$
      $Data/Property[@Name=”.1.3.6.1.4.1.8225.4711.17.1.1.2″]$

      $MPElement[Name=’QND.Network.Kemp.LoadMaster.IPVS’]/VSpersistenceTimeout$
      $Data/Property[@Name=”.1.3.6.1.4.1.8225.4711.17.1.1.7″]$

      $MPElement[Name=’QND.Network.Kemp.LoadMaster.IPVS’]/VSnumDests$
      $Data/Property[@Name=”.1.3.6.1.4.1.8225.4711.17.1.1.9″]$

      Discovery

      43200

      $MPElement[Name=’QND.Network.Kemp.LoadMaster.IPVS’]$

      $MPElement[Name=’Network!System.NetworkManagement.Node’]/DeviceKey$
      $Target/Host/Property[Type=”Network!System.NetworkManagement.Node”]/DeviceKey$

      $MPElement[Name=’Network!System.NetworkManagement.LogicalDevice’]/Key$
      $Target/Property[Type=”Network!System.NetworkManagement.LogicalDevice”]/Key$

      $MPElement[Name=’QND.Network.Kemp.LoadMaster.IPVS’]/Protocol$
      $Data/Property[@Name=”VSProtocol”]$

      $MPElement[Name=’QND.Network.Kemp.LoadMaster.IPVS’]/VSAddrType$
      $Data/Property[@Name=”VSAddrType”]$

    • #19 by Peter on March 18, 2016 - 1:58 pm

      Hi again! Sorry for bashing you with questions. I Think I’m getting the hang of this but cant seem to reach a solution to my problem.

      Here is the MIB for the Virtual service (below).

      From the Loadbalancer documentation:
      Monitoring Layer 4 RIPs using SNMP
      To list the Virtual Services use the command shown below:
      [root@lbmaster ~]# snmpwalk -c public -v 2c -m LVS-MIB localhost 1.3.6.1.4.1.8225.4711.17.1.4

      So in my book the Table should start with:
      .1.3.6.1.4.1.8225.4711.17
      That meaning that the OID should be:
      .1.3.6.1.4.1.8225.4711.17.1
      TableIndexOID should be:
      .1.3.6.1.4.1.8225.4711.17.1.1

      Is this correct?

      lvsServiceTable OBJECT-TYPE
      SYNTAX SEQUENCE OF lvsServiceEntry
      MAX-ACCESS not-accessible
      STATUS current
      DESCRIPTION
      “A table containing lvs service-specific information.”
      ::= { lvs 17 }

      lvsServiceEntry OBJECT-TYPE
      SYNTAX LvsServiceEntry
      MAX-ACCESS not-accessible
      STATUS current
      DESCRIPTION
      “information about a lvs service”
      INDEX { lvsServiceNumber }
      ::= { lvsServiceTable 1 }

      LvsServiceEntry ::= SEQUENCE {
      lvsServiceNumber INTEGER,
      lvsServiceSchedType OCTET STRING,
      lvsServiceProto INTEGER,
      lvsServiceAddr IpAddress,
      lvsServicePort INTEGER,
      lvsServiceFWMark INTEGER,
      lvsServicePersistTimeout TimeInterval,
      lvsServiceNumDests INTEGER,
      lvsServiceStatsConns Counter32,
      lvsServiceStatsInPkts Counter32,
      lvsServiceStatsOutPkts Counter32,
      lvsServiceStatsInBytes Counter64,
      lvsServiceStatsOutBytes Counter64,
      lvsServiceRateCps Gauge32,
      lvsServiceRateInPPS Gauge32,
      lvsServiceRateOutPPS Gauge32,
      lvsServiceRateInBPS Gauge32,
      lvsServiceRateOutBPS Gauge32
      }

      lvsServiceNumber OBJECT-TYPE
      SYNTAX INTEGER (0..65535)
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “The lvs service number”
      ::= { lvsServiceEntry 1 }

      lvsServiceSchedType OBJECT-TYPE
      SYNTAX OCTET STRING (SIZE(0..16))
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “Scheduler Type”
      ::= { lvsServiceEntry 2 }

      lvsServiceProto OBJECT-TYPE
      SYNTAX INTEGER {
      fwmark(-1),
      tcp(6),
      udp(17),
      }
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “Protocol (tcp/udp) or packets marked by fwmark”
      ::= { lvsServiceEntry 3 }

      lvsServiceAddr OBJECT-TYPE
      SYNTAX IpAddress
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “IP Address of the Service a.k.a Virtual IP (VIP)”
      ::= { lvsServiceEntry 4 }

      lvsServicePort OBJECT-TYPE
      SYNTAX INTEGER {
      fwmark(-1),
      }
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “The port number of the service”
      ::= { lvsServiceEntry 5 }

      lvsServiceFWMark OBJECT-TYPE
      SYNTAX INTEGER {
      undefined(0);
      }
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “The Firewall Mark which tags connections to be processed by this lvs service”
      ::= { lvsServiceEntry 6 }

      lvsServicePersistTimeout OBJECT-TYPE
      SYNTAX TimeInterval
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “The Timeout of persistent connections in 1/100 s”
      ::= { lvsServiceEntry 7 }

      lvsServicePersistNetmask OBJECT-TYPE
      SYNTAX IpAddress
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “The netmask of persitent connections”
      ::= { lvsServiceEntry 8 }

      lvsServiceNumDests OBJECT-TYPE
      SYNTAX INTEGER (0..65535)
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “the number of realservers for this virtual server”
      ::= { lvsServiceEntry 9 }

      lvsServiceStatsConns OBJECT-TYPE
      SYNTAX Counter32
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “the total number of connections which has been handled by this lvs service since the beginning”
      ::= { lvsServiceEntry 10 }

      lvsServiceStatsInPkts OBJECT-TYPE
      SYNTAX Counter32
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “the total number of incomming pakets to this lvs service”
      ::= { lvsServiceEntry 11 }

      lvsServiceStatsOutPkts OBJECT-TYPE
      SYNTAX Counter32
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “the total number of outgoing pakets from this lvs service (always 0 for LVS-DR)”
      ::= { lvsServiceEntry 12 }

      lvsServiceStatsInBytes OBJECT-TYPE
      SYNTAX Counter64
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “the total number of incomming bytes from this lvs service”
      ::= { lvsServiceEntry 13 }

      lvsServiceStatsOutBytes OBJECT-TYPE
      SYNTAX Counter64
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “the number of outgoing bytes from this lvs service (always 0 for LVS-DR)”
      ::= { lvsServiceEntry 14 }

      lvsServiceRateCps OBJECT-TYPE
      SYNTAX Gauge32
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “the current connection rate”
      ::= { lvsServiceEntry 15 }

      lvsServiceRateInPPS OBJECT-TYPE
      SYNTAX Gauge32
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “the current in packet rate”
      ::= { lvsServiceEntry 16 }

      lvsServiceRateOutPPS OBJECT-TYPE
      SYNTAX Gauge32
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “the current out packet rate”
      ::= { lvsServiceEntry 17 }

      lvsServiceRateInBPS OBJECT-TYPE
      SYNTAX Gauge32
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “the current in byte rate”
      ::= { lvsServiceEntry 18 }

      lvsServiceRateOutBPS OBJECT-TYPE
      SYNTAX Gauge32
      MAX-ACCESS read-only
      STATUS current
      DESCRIPTION
      “the current out byte rate”
      ::= { lvsServiceEntry 19 }

      • #20 by Daniele Grandini on March 30, 2016 - 12:04 pm

        yes this what I understand from the MIB ..17.1.4 is the VIP of the virtual service and ..17.1 is the table OID, ..17.1.1 is the table index (or key property)

  6. #21 by Brett on September 8, 2014 - 9:08 pm

    This is an outstanding article! I just found it.
    I’ve been staring at the xSNMP pack in our OpsMan 2007 environment trying to make sense of porting it to 2012. This helps a ton. Honestly, I’m still a little confused but I’ll read it a few more times and start trying to discover/monitor some components. I’m starting with fans and power supplies.
    I’m noticing that OM2012 isn’t discovering components correctly even for certified devices. For example I can look at 2007 and see 1 chassis and 2 PSU fans for a Cisco switch. When look at OM2012 I see maybe 1 fan and sometimes that even has an index of 0 which is incorrect. Same goes for PSUs. Since OM2012 is unreliable I’m going to attempt to just discover fans and PSUs again using something similar to what you’ve done with the disks.
    I have about 25 different types of Cisco devices including switches, routers and WAPs. I’d be willing to help you test code for the Cisco stuff but I don’t have other brands. The network gear I monitor is the only reason I’m keeping our ’07 environment up. As soon as I can replicate xSNMP in the 2012 OM then I’ll shut ’07 down.
    xSNMP has other things that I can’t lose like rules for configuration changes, default gateway changes, HSRP state change that I’ll need to bring into 2012 as well.
    Thanks again for your article. Hopefully it gets me over the learning curve faster.
    BTW, someone mentioned the MPAuthor stuff in chapter 3’s comments. I believe that was a sample management pack for 2007 from Brian Wren.

    • #22 by Daniele Grandini on September 9, 2014 - 5:17 pm

      Hi Brett,
      thank you for reading. If you want to contribute to xSNMP porting you can join the codeplex Project. You’re right the current network monitoring stuff is basically availability and port monitoring. We need more, not so much more, but at least sensors and moving parts (fans, disks, …) are badly needed.

  7. #23 by jvjean on July 15, 2014 - 9:30 am

    It looks like an awesome library Daniele, discovering SNMP table is such a pain!
    I will surely test it really soon!

  8. #24 by David Gallay on July 7, 2014 - 9:52 pm

    This seems like it will be really helpful to a lot of people. I’m currently trying to use it to discover and map out some components on our Netscaler devices, but so far I haven’t been able to get it to work. Will you be releasing a sample management pack that shows how all of the pieces work together?

    • #25 by Daniele Grandini on July 8, 2014 - 2:00 pm

      Hi David, the short answer is yes. I’m planning to post con codeplex a complete MP soon, and then to start porting the old xSNMP monitored devices.

      • #26 by David Gallay on July 9, 2014 - 3:42 pm

        Excellent! I’ll look forward to it … as more of a sysadmin than a developer, I’m just getting comfortable with VSAE but the SNMP stuff has been driving me crazy.

    • #27 by Daniele Grandini on July 8, 2014 - 4:50 pm

      First sample the old way, before the new module, https://kemplmmp.codeplex.com

    • #28 by Luc on July 9, 2014 - 11:25 am

      Hello, I have no experience with MP development. I need to monitor a device that have a snmp table with the current alerts of that device and I need them in scom. I have imported the library. What need I do more for this to work. Thanks. Luc

      • #29 by Daniele Grandini on July 11, 2014 - 9:37 am

        Hi Luc,
        it’s a long journey from here to there. I will soon start to post more MP that uses the new module so they can be used as reference MP. The plan is to migrate the most interesting devices from the old and glorious xSNMP project (still on codeplex). To start I suggest to read all the article series and have at hands the SNMP mibs and walk for your device. Then start one step at time: first with the discovery part and then adding some monitors and rules.
        – Daniele

  9. #30 by bradc on June 20, 2014 - 5:02 pm

    amazement

    • #31 by Daren Daigle on June 23, 2015 - 1:12 pm

      I wonder how this could be applied to collecting snmp counters (in tables) for performance and trending.

      • #32 by Daniele Grandini on June 24, 2015 - 10:20 am

        Hi Daren,
        the technique is exactly the same, the script will return a property bag with the performance or state values that you need. Check the QND SNMP Library for pre-cooked data sources or get the Kemp MP that contains code similar to what you are asking for.
        -Daniele

  1. jordandunkel8190.bligoo.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: