[prev in list] [next in list] [prev in thread] [next in thread] 

List:       opennms-discuss
Subject:    [opennms-discuss] Up a creek with provisioning and SNMP collection
From:       Alexander Hoogerhuis <alexh () boxed ! no>
Date:       2014-04-17 20:14:18
Message-ID: 5350361A.7070308 () boxed ! no
[Download RAW message or body]

I'm trying to accomplish something that seems simple on the face of it: 
I want my provisioning policy to control exactly what interfaces are 
collected on a given node.

Currently the policy looks like this:

> <policy name="IP if" \
> class="org.opennms.netmgt.provision.persist.policies.MatchingIpInterfacePolicy"> \
> <parameter key="action" value="DO_NOT_PERSIST"/> <parameter key="matchBehavior" \
> value="ANY_PARAMETER"/> <parameter key="ipAddress" \
> value="~((^127\..*)|(^128\..*|^30\.1[78]\..*|^129\.16\..*|^130\.16\..*|^10\.0\..*))"/>
>  </policy>
> <policy name="SNMP if" \
> class="org.opennms.netmgt.provision.persist.policies.MatchingSnmpInterfacePolicy"> \
> <parameter key="action" value="DO_NOT_PERSIST"/> <parameter key="matchBehavior" \
> value="NO_PARAMETERS"/> <parameter key="ifName" \
> value="~(vlan\..*|ae\d|fe\-.*\/\d+?\.\d+?|ge\-.*\/\d+?\.\d+?|reth\d+?\.\d+?|st0\.\d+?)"/>
>  </policy>

The first policy is just there to eliminate various IP interfaces on the 
box that we don't need to care about.

The second policy is for the same purpose, to only add SNMP interfaces 
we explicitly name.

So far so good, any provisioned node will show up with the right amount 
of expected IP and SNMP interfaces.

Then we added a third policy to have a better control of what is collected:

> <policy name="Collect if" \
> class="org.opennms.netmgt.provision.persist.policies.MatchingSnmpInterfacePolicy"> \
> <parameter key="action" value="DISABLE_COLLECTION"/> <parameter key="matchBehavior" \
> value="NO_PARAMETERS"/> <parameter key="ifAlias" value="~(.*NMS:\S*?COLLECT.*)"/>
> </policy>

This one basically says "disable any collection that does not match 
ifAlias (the interfaces description field on the box) containing 
"NMS:COLLECT" (allowing for  various other values we use for other 
purposes).

For some reason when we go look at the node's information about which 
interfaces are collected and not collected, it does match 1 out of 2 
that have the above tag (NMS:COLLECT) and then adds on a few interfaces 
that have no description but are SVI type interfaces named "vlan.100", 
"vlan.200", etc.

I have tried chainging the snmpStorageFlag to "primary" without this 
being able to limit the problem.

This is on 1.12.5 (and 1.12.6 as it stands as of this morning), and I'm 
just at a loss for what else controls what is and what is not being 
flagged for collection.

 From the provisioning log I see this when it's adding collection for an 
interface we didn't ask for it to collect (i.e. snmpifalias = ''):

> 2014-04-17 22:01:00,061 DEBUG [scanExecutor-5] AddEventVisitor: snmpinterface = \
> [OnmsSnmpInterface@e361f snmpipadentnetmask = /255.255.255.128, snmpphysaddr = \
> 'b0a86e622c88', snmpifindex = 535, snmpifdescr = 'vlan.100', snmpiftype = 135, \
> snmpifname = 'vlan.100', snmpifspeed = 0, snmpifadminstatus = 1, snmpifoperstatus = \
> 1, snmpifalias = '', snmpCollect = 'C', snmpPoll = 'N', lastCapsdPoll = 2014-04-17 \
> 22:00:59.146, lastSnmpPoll = [null]]

And I just can't figure what has set OpenNMS' mind on collecting that 
(and other) unwanted interfaces.

mvh,
A
-- 
Alexander Hoogerhuis | http://no.linkedin.com/in/alexh
Boxed Solutions AS   | +47 908 21 485 - alexh@boxed.no
"Given enough eyeballs, all bugs are shallow." -Eric S. Raymond

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic