Implement PersistenceSelectorStrategy framework
Description
Environment
Acceptance / Success Criteria
is duplicated by
Lucidchart Diagrams
Activity

Alejandro Galue September 19, 2011 at 4:08 PM
I've added a real working example for PersistRegexSelectorStrategy on datacollection/netsnmp.xml, for the resource type of Disk IO (UCD-SNMP MIB), in order to persist only the information for drives and file systems and avoid ram and loop devices.
Keep in mind that ucd-diskio doesn't belong to any systemDef by default, so you need to add it manually to the proper systemDef.
Check the revision 9460adf94beba146c021dd76d3a6db6bac4431a8 for 1.10

Alejandro Galue June 21, 2011 at 10:37 PM
Fixed on f83834eae4102c9673ab091e76a9ac02e52f8dc3 for branch 1.10
There are currently two implementations:
1. PersistAllSelectorStrategy, the default class used inside datacollection-config.xml (it doesn't do anything)
2. PersistRegexSelectorStrategy, which uses Spring Expression Language to filter resources over any mibObj element defined as string with the same resource type, for example:
<persistenceSelectorStrategy class="org.opennms.netmgt.collectd.PersistRegexSelectorStrategy">
<parameter key="match-expression" value="#hrStorageType matches '^\.1\.3\.6\.1\.2\.1\.25\.2\.1\.4$'" />
</persistenceSelectorStrategy>
You could use as many match-expression parameters as you want. They will be applied in the same order as they are found inside the persistenceSelectorStrategy's tag. If one matches the expression, the resource will be persisted, otherwise will be rejected.
That will affect only the data persister, not the thresholding.

Michael Little May 23, 2011 at 3:48 PM
We use NFS extensively and currently when collecting hrStorage, the mounted volumes get collected on every node. Not real useful.

Jeff Gehlbach April 29, 2009 at 9:28 AM
Changed subject to reflect what's actually involved. Persistence selectors were part of the original design of the generic-index collection framework, but they never got implemented. This is a needed improvement.

Andrew Artemyev April 17, 2009 at 2:32 AM
has been marked as a duplicate of this bug. ***
Andrew Artemyev brought up this idea on the opennms-discuss list (http://markmail.org/thread/o5uf5ie5fpvwffzj)
After creating a custom resourceType, it would be nice to have a way to limit the number of indices (indexes) which have data collected. This may be similar to choosing which interfaces of a switch are included in data collection. Presently, when a custom resourceType is defined to collect arbitrarily indexed data (via SNMP), all indices are collected on. In some cases there may be only a few interesting indices to collect data on among hundreds or thousands. The problem is exacerbated if multiple data points are defined for collection.