Seems safer, I pondered that after I sent the e-mail yesterday.

I've uploaded a patch to NMS-4958 with that fix in it.

Duncan
________________________________________
From: Seth Leger [s...@opennms.org]
Sent: 05 October 2011 18:59
To: OpenNMS Code Development and Bugs
Cc: Duncan Mackintosh
Subject: Re: [opennms-devel] NMS-4958 - preventing SNMP node scan on new nodes

Simplifying it to:

if(SnmpDetector.class.getName().equals(d.getPluginClass())) {

seems like it should be OK. If the class is ever renamed or refactored,
that clause will still work.

-- Seth Leger


On 10/05/2011 01:07 PM, Duncan Mackintosh wrote:
> We've run into the same issue as NMS-4958 where we've got nodes (in our case 
> imported from a .xml file) that we don't want NMS scanning via SNMP. I've 
> discussed with RangerRick on IRC and created *a* fix in my local repo, which 
> is to add
>
>             // If the foreign source is configured not to use an SNMP 
> detector, trying to detect
>             // capabilities using SNMP seems rude.
>             boolean isSNMPDetecting = false;
>             for(PluginConfig d : fs.getDetectors()) {
>                 
> if("org.opennms.netmgt.provision.detector.snmp.SnmpDetector".equals(d.getPluginClass()))
>  {
>                     isSNMPDetecting = true;
>                 }
>             }
>             if(!isSNMPDetecting) {
>                 return null;
>             }
>
> in DefaultProvisionService.createScheduleForNode(). It works, but 
> string-comparison on the classname seems a bit ugly and/or fragile so I'm 
> throwing the fix out here in case anyone has a better idea before I submit a 
> patch to the bug.
>
> Cheers,
> Duncan Mackintosh (dijm)
> Cambridge Broadband Networks Limited Registered in England and Wales under 
> company number: 03879840 Registered office: Selwyn House, Cambridge Business 
> Park, Cowley Road, Cambridge CB4 0WZ, UK. VAT number: GB 741 0186 64
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2dcopy1
> _______________________________________________
> Please read the OpenNMS Mailing List FAQ:
> http://www.opennms.org/index.php/Mailing_List_FAQ
>
> opennms-devel mailing list
>
> To *unsubscribe* or change your subscription options, see the bottom of this 
> page:
> https://lists.sourceforge.net/lists/listinfo/opennms-devel
>

Cambridge Broadband Networks Limited Registered in England and Wales under 
company number: 03879840 Registered office: Selwyn House, Cambridge Business 
Park, Cowley Road, Cambridge CB4 0WZ, UK. VAT number: GB 741 0186 64

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this 
page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel

Reply via email to