[prev in list] [next in list] [prev in thread] [next in thread]
List: opennms-devel
Subject: [opennms-devel] Remote polling on same IP schemes
From: "Ryan Kagin" <rkagin () pavlovmedia ! com>
Date: 2007-08-08 20:12:56
Message-ID: 678CA7EF9C2ADE4D9EE4DB82E0F63D8F3E4B5B () caballus ! fusionbb ! corp
[Download RAW message or body]
--===============0071601708==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C7D9F8.828CBD4F"
This is a multi-part message in MIME format.
Our problem is as follows (I apologize for those who have already heard this):
We have several sites, each with a router and switches behind the router which are \
unaccessable from the web. The switches all have the same IP scheme - 192.168.5.10, \
192.168.5.15, etc. The problem is that when we have two remote pollers on two \
different sites polling the same service, the scheduler schedules all IPs that are \
the same, even if the node IDs are different.
A bug report has been filed on this issue, which is bug 1969.
Below is what I believe could be a start to patch this problem for us, but I am not \
sure how to proceed.
------------------------------------------------------------------------
This is the original code from
/usr/local/src/opennms-1.3.5-1/source/opennms-dao/src/main/java/org/opennms/netmgt/dao/hibernate/MonitoredServiceDaoHibernate.java
========================================================================
73 public Collection<OnmsMonitoredService> \
findMatchingServices(ServiceSelector selector) {
74 Set<String> matchingIps = new \
HashSet<String>(FilterDaoFactory.getInstance().getIPList(selector.getFilterRule()));
75 Set<String> matchingSvcs = new \
HashSet<String>(selector.getServiceNames()); 76
77 List<OnmsMonitoredService> matchingServices = new \
LinkedList<OnmsMonitoredService>(); 78 Collection<OnmsMonitoredService> \
services = findAll(); 79 for (OnmsMonitoredService svc : services) {
80 if ((matchingSvcs.contains(svc.getServiceName()) || \
matchingSvcs.isEmpty()) && 81 \
matchingIps.contains(svc.getIpAddress())) { 82
83 matchingServices.add(svc);
84 }
85
86 }
87
88
89 return matchingServices;
90 }
========================================================================
I want to edit it to be the following:
========================================================================
73 public Collection<OnmsMonitoredService> \
findMatchingServices(ServiceSelector selector) {
74 Set<String> matchingIps = new \
HashSet<String>(FilterDaoFactory.getInstance().getIPList(selector.getFilterRule()));
75 Set<String> matchingSvcs = new \
HashSet<String>(selector.getServiceNames());
> Set<String> matchingNodeId = new HashSet<String>(select.getNodeId());
76
77 List<OnmsMonitoredService> matchingServices = new \
LinkedList<OnmsMonitoredService>(); 78 Collection<OnmsMonitoredService> \
services = findAll(); 79 for (OnmsMonitoredService svc : services) {
80 if ((matchingSvcs.contains(svc.getServiceName()) || \
matchingSvcs.isEmpty()) && > \
matchingNodeId.contains(svc.getNodeId()) && 81 \
matchingIps.contains(svc.getIpAddress())) { 82
83 matchingServices.add(svc);
84 }
85
86 }
87
88
89 return matchingServices;
90 }
========================================================================
This would require two things:
* The OnmsMonitoredService class has getNodeId() which would return the node id for \
which the service is attached to. This is already implemented.
* The ServiceSelector class has getNodeId() which would return the node ID for the \
service (similar to above). This is not implemented. I would think that you could \
just throw in the function and the variable to be stored, but then we would have to \
go into all the files that instantiate ServiceSelector's, and make sure they assign \
the proper node ID. This seems to only be effecting a few files, which include the \
Package class, a class which seems to be compiled on the fly through an xsd file. \
The other file that uses ServiceSelector is DefaultCategoryStatusService.java, \
function createCategory, which creates a new ServiceSelector in the function. I'm \
not sure if others use it or not, but we would have to find all of them (or minimally \
the ones that effect remote polling), and edit them to set and read data properly \
from the ServiceSelector class.
------------------------------------------------------------------------
Any help would be greatly appreciated. I have taken another position on solving this \
issue, by creating a test case that demonstrates the failure. That information is \
posted in comment 2 of the bug listed above.
Thanks,
Ryan K
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>Remote polling on same IP schemes</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Our problem is as follows (I apologize for those who have already \
heard this):<BR> We have several sites, each with a router and switches behind the \
router which are unaccessable from the web. The switches all have the same IP \
scheme - 192.168.5.10, 192.168.5.15, etc. The problem is that when we have two \
remote pollers on two different sites polling the same service, the scheduler \
schedules all IPs that are the same, even if the node IDs are different.<BR> <BR>
A bug report has been filed on this issue, which is bug 1969.<BR>
<BR>
Below is what I believe could be a start to patch this problem for us, but I am not \
sure how to proceed.<BR>
------------------------------------------------------------------------<BR>
This is the original code from<BR>
/usr/local/src/opennms-1.3.5-1/source/opennms-dao/src/main/java/org/opennms/netmgt/dao/hibernate/MonitoredServiceDaoHibernate.java<BR>
========================================================================<BR>
73 public \
Collection<OnmsMonitoredService> findMatchingServices(ServiceSelector selector) \
{<BR> 74 \
Set<String> matchingIps = new \
HashSet<String>(FilterDaoFactory.getInstance().getIPList(selector.getFilterRule()));<BR>
75 \
Set<String> matchingSvcs = new \
HashSet<String>(selector.getServiceNames());<BR> \
76<BR> 77 \
List<OnmsMonitoredService> matchingServices = new \
LinkedList<OnmsMonitoredService>();<BR> \
78 \
Collection<OnmsMonitoredService> services = findAll();<BR> \
79 for \
(OnmsMonitoredService svc : services) {<BR> \
80 if \
((matchingSvcs.contains(svc.getServiceName()) || matchingSvcs.isEmpty()) \
&&<BR> \
81 \
matchingIps.contains(svc.getIpAddress())) {<BR> 82<BR>
\
83 \
matchingServices.add(svc);<BR> \
84 }<BR> \
85<BR> \
86 }<BR> \
87<BR> 88<BR>
89 return \
matchingServices;<BR> 90 }<BR>
========================================================================<BR>
I want to edit it to be the following:<BR>
========================================================================<BR>
73 public \
Collection<OnmsMonitoredService> findMatchingServices(ServiceSelector selector) \
{<BR> 74 \
Set<String> matchingIps = new \
HashSet<String>(FilterDaoFactory.getInstance().getIPList(selector.getFilterRule()));<BR>
75 \
Set<String> matchingSvcs = new \
HashSet<String>(selector.getServiceNames());<BR> \
> Set<String> \
matchingNodeId = new HashSet<String>(select.getNodeId());<BR> \
76<BR> \
77 List<OnmsMonitoredService> \
matchingServices = new LinkedList<OnmsMonitoredService>();<BR> \
78 \
Collection<OnmsMonitoredService> services = findAll();<BR> \
79 for \
(OnmsMonitoredService svc : services) {<BR> \
80 if \
((matchingSvcs.contains(svc.getServiceName()) || matchingSvcs.isEmpty()) \
&&<BR> \
> \
matchingNodeId.contains(svc.getNodeId()) &&<BR> \
81 \
matchingIps.contains(svc.getIpAddress())) {<BR> 82<BR>
\
83 \
matchingServices.add(svc);<BR> \
84 }<BR> \
85<BR> \
86 }<BR> \
87<BR> 88<BR>
89 return \
matchingServices;<BR> 90 }<BR>
========================================================================<BR>
This would require two things:<BR>
* The OnmsMonitoredService class has getNodeId() which would return the node id for \
which the service is attached to. This is already \
implemented.<BR>
* The ServiceSelector class has getNodeId() which would return the node ID for the \
service (similar to above). This is not implemented.<BR> I would think that you \
could just throw in the function and the variable to be stored, but then we would \
have to go into all the files that instantiate ServiceSelector's, and make sure they \
assign the proper node ID. This seems to only be effecting a few files, which \
include the Package class, a class which seems to be compiled on the fly through an \
xsd file. The other file that uses ServiceSelector is \
DefaultCategoryStatusService.java, function createCategory, which creates a new \
ServiceSelector in the function. I'm not sure if others use it or not, but we \
would have to find all of them (or minimally the ones that effect remote polling), \
and edit them to set and read data properly from the ServiceSelector \
class.<BR>
------------------------------------------------------------------------<BR>
Any help would be greatly appreciated. I have taken another position on solving \
this issue, by creating a test case that demonstrates the failure. That \
information is posted in comment 2 of the bug listed above.<BR> <BR>
Thanks,<BR>
Ryan K</FONT>
</P>
</BODY>
</HTML>
[Attachment #4 (--===============0071601708==)]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic