Re: SNMP collection with Arbitrary Indexes

Jeff Gehlbach <[email protected]>
Newsgroups gmane.network.opennms.general
Message-ID <[email protected]>
Hi Aaron,

> How would I go about collecting this data?
> 
> Attached is the MIB.

This use case is like an onion: it has layers and it's likely to make
one cry. I started out thinking it a great example to show off a new
facility that Alejandro added late last year, but it's less
straightforward than I first thought. I'm essentially putting on
blinders here and focusing on getting the outletLabel to appear on the
same level with the measurement values.

Thanks for including the MIB; the below would have been impossible
without it. Here's my take.

The table containing the outletLabel object is doubly-indexed:

outletConfigurationEntry     OBJECT-TYPE
...
                INDEX         { pduId, outletId }

The table with the measurements is triply-indexed:

outletSensorMeasurementsEntry     OBJECT-TYPE
...
                INDEX         { pduId, outletId, sensorType  }

The first two components match those of the table containing the labels,
but the third is actually an enumerated integer type which denotes the
type of sensor described by the row at hand. This is what we in the
brotherhood call "a pain in the butt". It would be far easier to deal
with if outletId were the final component of both indexes.

If you have multiple different sensor types, you'll need to do extra
work to extract the "sensorType" value from the instance identifier, and
configure a persistence-selector to save only the rows for the sensor
types you care about. For the purposes of this reply, I'm assuming you
have only rmsCurrent sensors.

You'll need to make two resource-types and two groups: one for the
outletConfigurationTable and another for the outletSensorMeasurementsTable.

The former type and group will be totally straightforward.

In the latter group you'll use a new tag, <property>, to "teleport" the
outletLabel string attribute from the first group. It's pretty abstract;
this issue describes its design and operation:

https://issues.opennms.org/browse/NMS-8484

I would expect your setup to look something like:

  <resourceType name="outletConfigurationEntry" label="Raritan PDU
Outlet Configuration" resourceLabel="${outletLabel}">...</resourceType>

  <resourceType name="outletSensorMeasurementsEntry" label="Raritan PDU
Outlet Sensor Measurement" resourceLabel="${outletLabel}">...</resourceType>

  <group name="outletConfigurationTable" ifType="all">
    <mibObj oid=".1.3.6.1.4.1.13742.6.3.5.3.1.2.1"
instance="outletConfigurationEntry" alias="outletLabel" type="string" />
  </group>

  <group name="outletSensorMeasurementsTable" ifType="all">
    <mibObj oid=".1.3.6.1.4.1.13742.6.5.4.3.1.4.1"
instance="outletSensorMeasurementsEntry" alias="outletSensorValue"
type="gauge" />
    <property instance="outletSensorMeasurementsEntry"
source-type="outletConfigurationEntry" source-alias="outletLabel"
index-pattern="^(.+)\.\d+$" />
  </group>

The final layer is the first index component, "pduId". I pegged its
value to "1" in all the above configs. If you need to handle rows where
that identifier has a different value, you'll probably do best to
configure different versions of the "outletSensorMeasurementsEntry"
resource-type and the "outletSensorMeasurementsTable" group.

I hope this helps more than it confuses!

-jeff

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-discuss mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.