Index: opennms-daemon/src/main/filtered/etc/snmp-graph.properties
===================================================================
--- opennms-daemon/src/main/filtered/etc/snmp-graph.properties (revision 9912)
+++ opennms-daemon/src/main/filtered/etc/snmp-graph.properties (working copy)
@@ -123,7 +123,8 @@
airport.numClients,iisTraffic,iisRequests,exchangeMessages,exchangeBytes, \
exchangeRecipPartitions,dnsThroughput,mssqlmemory,mssqlusage,mssqlhitratios,mssqllockwaittime, \
windowsCPU,livecommsusers,livecommsmessages,mailmarshal, \
-alvarion.droppedrec,alvarion.surb-stats,alvarion.lqi-stats
+alvarion.droppedrec,alvarion.surb-stats,alvarion.lqi-stats, \
+framerelay.bits, framerelay.frames, framerelay.congestion
# values available to prefab reports:
@@ -7903,5 +7904,70 @@
LINE1:powerUsagePeakWatts#ff0000:"Peak Watts" \
GPRINT:powerUsagePeakWatts:MAX:" \\: %3.0lf%s"
+report.framerelay.bits.name=Bits In/Out
+report.framerelay.bits.columns=frReceivedOctets,frSentOctets
+report.framerelay.bits.propertiesValues=frDlci
+report.framerelay.bits.type=frCircuitIfIndex
+report.framerelay.bits.command=--title="Bits In/Out of DLCI {frDlci}" \
+ --vertical-label="Bits per second" \
+ DEF:octIn={rrd1}:frReceivedOctets:AVERAGE \
+ DEF:octOut={rrd2}:frSentOctets:AVERAGE \
+ CDEF:rawbitsIn=octIn,8,* \
+ CDEF:rawbitsOut=octOut,8,* \
+ CDEF:rawbitsOutNeg=0,rawbitsOut,- \
+ CDEF:rawtotBits=octIn,octOut,+,8,* \
+ CDEF:bitsIn=rawbitsIn,UN,0,rawbitsIn,IF \
+ CDEF:bitsOut=rawbitsOut,UN,0,rawbitsOut,IF \
+ CDEF:totBits=rawtotBits,UN,0,rawtotBits,IF \
+ CDEF:outSum=bitsOut,{diffTime},* \
+ CDEF:inSum=bitsIn,{diffTime},* \
+ CDEF:totSum=totBits,{diffTime},* \
+ AREA:rawbitsIn#00ff00:"In " \
+ GPRINT:rawbitsIn:AVERAGE:"Avg \\: %8.2lf %s" \
+ GPRINT:rawbitsIn:MIN:"Min \\: %8.2lf %s" \
+ GPRINT:rawbitsIn:MAX:"Max \\: %8.2lf %s\\n" \
+ AREA:rawbitsOutNeg#0000ff:"Out" \
+ GPRINT:rawbitsOut:AVERAGE:"Avg \\: %8.2lf %s" \
+ GPRINT:rawbitsOut:MIN:"Min \\: %8.2lf %s" \
+ GPRINT:rawbitsOut:MAX:"Max \\: %8.2lf %s\\n" \
+ GPRINT:inSum:AVERAGE:" Tot In \\: %8.2lf %s" \
+ GPRINT:outSum:AVERAGE:" Tot Out \\: %8.2lf %s" \
+ GPRINT:totSum:AVERAGE:" Tot \\: %8.2lf %s\\n"
+report.framerelay.frames.name=Frames In/Out
+report.framerelay.frames.columns=frReceivedFrames,frSentFrames
+report.framerelay.frames.propertiesValues=frDlci
+report.framerelay.frames.type=frCircuitIfIndex
+report.framerelay.frames.command=--title="Frames In/Out of DLCI {frDlci}" \
+ --vertical-label="Frames per Second" \
+ DEF:fpsIn={rrd1}:frReceivedFrames:AVERAGE \
+ DEF:fpsOut={rrd2}:frSentFrames:AVERAGE \
+ CDEF:fpsOutNeg=0,fpsOut,- \
+ AREA:fpsIn#00ff00:"In " \
+ GPRINT:fpsIn:AVERAGE:"Avg \\: %8.2lf %s" \
+ GPRINT:fpsIn:MIN:"Min \\: %8.2lf %s" \
+ GPRINT:fpsIn:MAX:"Max \\: %8.2lf %s\\n" \
+ AREA:fpsOutNeg#0000ff:"Out" \
+ GPRINT:fpsOut:AVERAGE:"Avg \\: %8.2lf %s" \
+ GPRINT:fpsOut:MIN:"Min \\: %8.2lf %s" \
+ GPRINT:fpsOut:MAX:"Max \\: %8.2lf %s\\n" \
+
+report.framerelay.congestion.name=FECNs / BECNs
+report.framerelay.congestion.columns=frReceivedBECNs,frReceivedFECNs
+report.framerelay.congestion.propertiesValues=frDlci
+report.framerelay.congestion.type=frCircuitIfIndex
+report.framerelay.congestion.command=--title="FECNs/BECNs of DLCI {frDlci}" \
+ --vertical-label="FECN/BECN per Second" \
+ DEF:becns={rrd1}:frReceivedBECNs:AVERAGE \
+ DEF:fecns={rrd2}:frReceivedFECNs:AVERAGE \
+ CDEF:fecnsNeg=0,fecns,- \
+ AREA:becns#00ff00:"BECNs" \
+ GPRINT:becns:AVERAGE:"Avg \\: %8.2lf %s" \
+ GPRINT:becns:MIN:"Min \\: %8.2lf %s" \
+ GPRINT:becns:MAX:"Max \\: %8.2lf %s\\n" \
+ AREA:fecnsNeg#0000ff:"FECNs" \
+ GPRINT:fecns:AVERAGE:"Avg \\: %8.2lf %s" \
+ GPRINT:fecns:MIN:"Min \\: %8.2lf %s" \
+ GPRINT:fecns:MAX:"Max \\: %8.2lf %s\\n" \
+
## EOF
Index: opennms-daemon/src/main/filtered/etc/datacollection-config.xml
===================================================================
--- opennms-daemon/src/main/filtered/etc/datacollection-config.xml (revision 9912)
+++ opennms-daemon/src/main/filtered/etc/datacollection-config.xml (working copy)
@@ -9,6 +9,11 @@
RRA:MIN:0.5:288:366
+
+
+
+
+
@@ -36,7 +41,7 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1754,6 +1780,8 @@
adsl-line
cisco-rttmon-latest-jitter-stats
cisco-rttmon-latest-rtp-stats
+ rfc1315-frame-relay
+ cisco-frame-relay
@@ -1929,6 +1957,7 @@
mib2-host-resources-system
mib2-host-resources-memory
+ mib2-host-resources-storage
net-snmp-disk
ucd-loadavg
ucd-memory
Index: opennms-dao/src/main/java/org/opennms/netmgt/dao/support/FrameRelayStorageStrategy.java
===================================================================
--- opennms-dao/src/main/java/org/opennms/netmgt/dao/support/FrameRelayStorageStrategy.java (revision 0)
+++ opennms-dao/src/main/java/org/opennms/netmgt/dao/support/FrameRelayStorageStrategy.java (revision 0)
@@ -0,0 +1,54 @@
+//
+// This file is part of the OpenNMS(R) Application.
+//
+// OpenNMS(R) is Copyright (C) 2008 The OpenNMS Group, Inc. All rights reserved.
+// OpenNMS(R) is a derivative work, containing both original code, included code and modified
+// code that was published under the GNU General Public License. Copyrights for modified
+// and included code are below.
+//
+// OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// For more information contact:
+// OpenNMS Licensing
+// http://www.opennms.org/
+// http://www.opennms.com/
+//
+package org.opennms.netmgt.dao.support;
+
+import java.util.StringTokenizer;
+
+/**
+ * This class use the new implementation of SnmpStorageStrategy extending the new
+ * IndexStorageStrategy from opennms-services
+ */
+public class FrameRelayStorageStrategy extends IndexStorageStrategy {
+
+ @Override
+ public String getResourceNameFromIndex(String resourceParent, String resourceIndex) {
+ StringTokenizer indexes = new StringTokenizer(resourceIndex, ".");
+ String ifIndex = indexes.nextToken();
+ String ifName = getInterfaceName(resourceParent, ifIndex);
+ String dlci = indexes.nextToken();
+ return ifName + "." + dlci;
+ }
+
+ public String getInterfaceName(String nodeId, String ifIndex) {
+ String label = m_storageStrategyService.getSnmpInterfaceLabel(new Integer(ifIndex));
+ return label != null ? label : ifIndex;
+ }
+
+}
Index: opennms-dao/src/main/java/org/opennms/netmgt/dao/support/IndexStorageStrategy.java
===================================================================
--- opennms-dao/src/main/java/org/opennms/netmgt/dao/support/IndexStorageStrategy.java (revision 9911)
+++ opennms-dao/src/main/java/org/opennms/netmgt/dao/support/IndexStorageStrategy.java (working copy)
@@ -33,10 +33,12 @@
import java.io.File;
+import org.opennms.netmgt.config.StorageStrategyService;
import org.opennms.netmgt.config.StorageStrategy;
public class IndexStorageStrategy implements StorageStrategy {
private String m_resourceTypeName;
+ protected StorageStrategyService m_storageStrategyService;
public String getRelativePathForAttribute(String resourceParent, String resource,
String attribute) {
@@ -46,9 +48,11 @@
buffer.append(m_resourceTypeName);
buffer.append(File.separator);
buffer.append(resource);
- buffer.append(File.separator);
- buffer.append(attribute);
- buffer.append(RrdFileConstants.getRrdSuffix());
+ if (attribute != null) {
+ buffer.append(File.separator);
+ buffer.append(attribute);
+ buffer.append(RrdFileConstants.getRrdSuffix());
+ }
return buffer.toString();
}
@@ -59,4 +63,12 @@
public String getResourceTypeName() {
return m_resourceTypeName;
}
+
+ public String getResourceNameFromIndex(String resourceParent, String resourceIndex) {
+ return resourceIndex;
+ }
+
+ public void setStorageStrategyService(StorageStrategyService agent) {
+ m_storageStrategyService = agent;
+ }
}
Index: opennms-dao/src/main/java/org/opennms/netmgt/dao/support/HostFileSystemStorageStrategy.java
===================================================================
--- opennms-dao/src/main/java/org/opennms/netmgt/dao/support/HostFileSystemStorageStrategy.java (revision 0)
+++ opennms-dao/src/main/java/org/opennms/netmgt/dao/support/HostFileSystemStorageStrategy.java (revision 0)
@@ -0,0 +1,59 @@
+//
+// This file is part of the OpenNMS(R) Application.
+//
+// OpenNMS(R) is Copyright (C) 2008 The OpenNMS Group, Inc. All rights reserved.
+// OpenNMS(R) is a derivative work, containing both original code, included code and modified
+// code that was published under the GNU General Public License. Copyrights for modified
+// and included code are below.
+//
+// OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// For more information contact:
+// OpenNMS Licensing
+// http://www.opennms.org/
+// http://www.opennms.com/
+//
+package org.opennms.netmgt.dao.support;
+
+import org.opennms.netmgt.snmp.SnmpObjId;
+import org.opennms.netmgt.snmp.SnmpUtils;
+import org.opennms.netmgt.snmp.SnmpValue;
+
+public class HostFileSystemStorageStrategy extends IndexStorageStrategy {
+
+ public static String HR_STORAGE_DESC = ".1.3.6.1.2.1.25.2.3.1.3";
+
+ @Override
+ public String getResourceNameFromIndex(String resourceParent, String resourceIndex) {
+ SnmpObjId oid = SnmpObjId.get(HR_STORAGE_DESC + "." + resourceIndex);
+ SnmpValue snmpValue = SnmpUtils.get(m_storageStrategyService.getAgentConfig(), oid);
+ String value = (snmpValue != null ? snmpValue.toString() : resourceIndex);
+ /*
+ * Use special translation for root (base) filesystem
+ */
+ if (value.equals("/"))
+ return "_root_fs";
+ /*
+ * 1. Eliminate first slash character
+ * 2. Eliminate tabs and spaces on filesystem names
+ * 3. Replace slash (file separator) character with "-"
+ * 4. Remove Additional Information on Windows Drives
+ */
+ return value.replaceFirst("/", "").replaceAll("\\s", "").replaceAll("/", "-").replaceAll(":\\\\.*", "");
+ }
+
+}
Index: opennms-dao/src/main/java/org/opennms/netmgt/config/StorageStrategyService.java
===================================================================
--- opennms-dao/src/main/java/org/opennms/netmgt/config/StorageStrategyService.java (revision 0)
+++ opennms-dao/src/main/java/org/opennms/netmgt/config/StorageStrategyService.java (revision 0)
@@ -0,0 +1,45 @@
+//
+// This file is part of the OpenNMS(R) Application.
+//
+// OpenNMS(R) is Copyright (C) 2008 The OpenNMS Group, Inc. All rights reserved.
+// OpenNMS(R) is a derivative work, containing both original code, included code and modified
+// code that was published under the GNU General Public License. Copyrights for modified
+// and included code are below.
+//
+// OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// For more information contact:
+// OpenNMS Licensing
+// http://www.opennms.org/
+// http://www.opennms.com/
+//
+package org.opennms.netmgt.config;
+
+import org.opennms.netmgt.snmp.SnmpAgentConfig;
+
+public interface StorageStrategyService {
+
+ public SnmpAgentConfig getAgentConfig();
+
+ /*
+ * This method is used on StorageStrategy implementation when the resource index is associated to a
+ * physical interface like frame relay resources. OpenNMS always track changes on ifTable so, make SNMP
+ * queries on this table is redundant, and implementations of CollectionAgent know ifTable content always.
+ * This method give interface information from a specific ifIndex.
+ */
+ public String getSnmpInterfaceLabel(int ifIndex);
+}
Index: opennms-dao/src/main/java/org/opennms/netmgt/config/StorageStrategy.java
===================================================================
--- opennms-dao/src/main/java/org/opennms/netmgt/config/StorageStrategy.java (revision 9911)
+++ opennms-dao/src/main/java/org/opennms/netmgt/config/StorageStrategy.java (working copy)
@@ -35,4 +35,21 @@
public String getRelativePathForAttribute(String resourceParent, String resource, String attribute);
public void setResourceTypeName(String name);
+
+ /*
+ * This functions translate resourceIndex into a "unique" and "non-variable" name that could be identify
+ * a resource, as described earlier.
+ *
+ * This method could be expensive because it could require send SNMP queries and make complicated functions to
+ * build the name. So you must try to call it only when is necessary.
+ */
+ public String getResourceNameFromIndex(String resourceParent, String resourceIndex);
+
+ /*
+ * Add to a strategy the possibility to get additional information using SNMP when is necessary.
+ * There are complex tables on some MIBs where indexes depends on indexes from other tables (indirect indexing).
+ * For this kind of resources we must send some additional SNMP queries to build a unique name.
+ */
+ public void setStorageStrategyService(StorageStrategyService agent);
+
}
Index: opennms-services/src/main/java/org/opennms/netmgt/collectd/NodeInfo.java
===================================================================
--- opennms-services/src/main/java/org/opennms/netmgt/collectd/NodeInfo.java (revision 9911)
+++ opennms-services/src/main/java/org/opennms/netmgt/collectd/NodeInfo.java (working copy)
@@ -91,4 +91,9 @@
public String getInstance() {
return null; //For node type resources, use the default instance
}
+
+ public String getLabel() {
+ return null;
+ }
+
} // end class
Index: opennms-services/src/main/java/org/opennms/netmgt/collectd/AliasedResource.java
===================================================================
--- opennms-services/src/main/java/org/opennms/netmgt/collectd/AliasedResource.java (revision 9911)
+++ opennms-services/src/main/java/org/opennms/netmgt/collectd/AliasedResource.java (working copy)
@@ -123,4 +123,8 @@
public String getInstance() {
return null; //For node and interface type resources, use the default instance
}
+
+ public String getLabel() {
+ return getDomain() + '/' + getAliasDir();
+ }
}
Index: opennms-services/src/main/java/org/opennms/netmgt/collectd/CollectionResource.java
===================================================================
--- opennms-services/src/main/java/org/opennms/netmgt/collectd/CollectionResource.java (revision 9911)
+++ opennms-services/src/main/java/org/opennms/netmgt/collectd/CollectionResource.java (working copy)
@@ -67,4 +67,11 @@
* @return
*/
public String getInstance();
+
+ /**
+ * Returns a unique label for each resource depending on resource type.
+ * This label is the same label used when constructing the resource ID.
+ * @Return
+ */
+ public String getLabel();
}
Index: opennms-services/src/main/java/org/opennms/netmgt/collectd/CollectionAgent.java
===================================================================
--- opennms-services/src/main/java/org/opennms/netmgt/collectd/CollectionAgent.java (revision 9911)
+++ opennms-services/src/main/java/org/opennms/netmgt/collectd/CollectionAgent.java (working copy)
@@ -38,6 +38,7 @@
import java.net.InetAddress;
import java.util.Set;
+import org.opennms.netmgt.config.StorageStrategyService;
import org.opennms.netmgt.poller.NetworkInterface;
import org.opennms.netmgt.snmp.SnmpAgentConfig;
@@ -45,7 +46,7 @@
*
* @author Mathew Brozowski
*/
-public interface CollectionAgent extends NetworkInterface {
+public interface CollectionAgent extends NetworkInterface,StorageStrategyService {
public abstract String getHostAddress();
Index: opennms-services/src/main/java/org/opennms/netmgt/collectd/GenericIndexResource.java
===================================================================
--- opennms-services/src/main/java/org/opennms/netmgt/collectd/GenericIndexResource.java (revision 9911)
+++ opennms-services/src/main/java/org/opennms/netmgt/collectd/GenericIndexResource.java (working copy)
@@ -33,6 +33,7 @@
import java.io.File;
+import org.opennms.netmgt.config.StorageStrategy;
import org.opennms.netmgt.model.RrdRepository;
import org.opennms.netmgt.snmp.SnmpInstId;
@@ -40,6 +41,7 @@
private SnmpInstId m_inst;
private String m_name;
+ private String m_resourceLabel;
public GenericIndexResource(ResourceType def, String name, SnmpInstId inst) {
super(def);
@@ -47,19 +49,16 @@
m_inst = inst;
}
- // XXX should be based on the storageStrategy
@Override
public File getResourceDir(RrdRepository repository) {
- File rrdBaseDir = repository.getRrdBaseDir();
- File nodeDir = new File(rrdBaseDir, String.valueOf(getCollectionAgent().getNodeId()));
- File typeDir = new File(nodeDir, m_name);
- File instDir = new File(typeDir, m_inst.toString());
- log().debug("getResourceDir: " + instDir.toString());
- return instDir;
+ String resourcePath = getStrategy().getRelativePathForAttribute(getParent(), getLabel(), null);
+ File resourceDir = new File(repository.getRrdBaseDir(), resourcePath);
+ log().debug("getResourceDir: " + resourceDir);
+ return resourceDir;
}
public String toString() {
- return "node["+getCollectionAgent().getNodeId() + "]." + getResourceTypeName() + "[" + m_inst + "]";
+ return "node["+getCollectionAgent().getNodeId() + "]." + getResourceTypeName() + "[" + getLabel() + "]";
}
@@ -80,4 +79,23 @@
public String getInstance() {
return m_inst.toString();
}
+
+ private StorageStrategy getStrategy() {
+ return ((GenericIndexResourceType)getResourceType()).getStorageStrategy();
+ }
+
+ private String getParent() {
+ return String.valueOf(getCollectionAgent().getNodeId());
+ }
+
+ /*
+ * Because call getResourceNameFromIndex could be expensive.
+ * This class save the returned value from Strategy on a local variable.
+ */
+ public String getLabel() {
+ if (m_resourceLabel == null) {
+ m_resourceLabel = getStrategy().getResourceNameFromIndex(getParent(), getInstance());
+ }
+ return m_resourceLabel;
+ }
}
Index: opennms-services/src/main/java/org/opennms/netmgt/collectd/DefaultCollectionAgent.java
===================================================================
--- opennms-services/src/main/java/org/opennms/netmgt/collectd/DefaultCollectionAgent.java (revision 9911)
+++ opennms-services/src/main/java/org/opennms/netmgt/collectd/DefaultCollectionAgent.java (working copy)
@@ -261,6 +261,14 @@
return ifInfos;
}
+ public String getSnmpInterfaceLabel(int ifIndex) {
+ for (SnmpIfData ifData : getSnmpInterfaceData()) {
+ if (ifData.getIfIndex() == ifIndex)
+ return ifData.getLabelForRRD();
+ }
+ return null;
+ }
+
public long getSavedSysUpTime() {
return m_sysUpTime;
}
Index: opennms-services/src/main/java/org/opennms/netmgt/collectd/GenericIndexResourceType.java
===================================================================
--- opennms-services/src/main/java/org/opennms/netmgt/collectd/GenericIndexResourceType.java (revision 9911)
+++ opennms-services/src/main/java/org/opennms/netmgt/collectd/GenericIndexResourceType.java (working copy)
@@ -85,6 +85,8 @@
}
m_storageStrategy.setResourceTypeName(m_name);
+ if (getAgent() != null)
+ m_storageStrategy.setStorageStrategyService(getAgent());
}
@Override
Index: opennms-services/src/main/java/org/opennms/netmgt/collectd/HttpCollector.java
===================================================================
--- opennms-services/src/main/java/org/opennms/netmgt/collectd/HttpCollector.java (revision 9911)
+++ opennms-services/src/main/java/org/opennms/netmgt/collectd/HttpCollector.java (working copy)
@@ -675,6 +675,10 @@
public String getInstance() {
return null;
}
+
+ public String getLabel() {
+ return null;
+ }
}
class HttpCollectionAttributeType implements CollectionAttributeType {
Index: opennms-services/src/main/java/org/opennms/netmgt/collectd/AbstractCollectionResource.java
===================================================================
--- opennms-services/src/main/java/org/opennms/netmgt/collectd/AbstractCollectionResource.java (revision 9911)
+++ opennms-services/src/main/java/org/opennms/netmgt/collectd/AbstractCollectionResource.java (working copy)
@@ -111,4 +111,8 @@
public abstract boolean shouldPersist(ServiceParameters params);
-}
\ No newline at end of file
+ public String getLabel() {
+ return null;
+ }
+
+}