From OpenNMS
Contents |
OpenNMS TopN Reporting
Description
A TopN report analyzes the data that has been collected and stored as rrd (or jrb) files. It looks for N number of resources with the highest values in a specified set of data collections. A typical example would be to find the 20 network interfaces with the highest number of input octets. The results are tabulated and saved in reports that can be viewed through the OpenNMS web interface at Home / Report / Statistics Reports.
Example Configuration
The configuration file for TopN reports is $OPENNMS_HOME/etc/statsd-configuration.xml. An simple configuration might look like this. (The first five lines should not be changed.)
<?xml version="1.0"?> <statistics-daemon-configuration xmlns:this="http://www.opennms.org/xsd/config/statsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opennms.org/xsd/config/statsd http://www.opennms.org/xsd/config/statistics-daemon-configuration.xsd "> <package name="example1"> <filter>nodeLabel LIKE '%mynodes%'</filter> <packageReport name="TopN" description="Top 20 ifInOctets across mynodes" schedule="0 20 1 * * ?" retainInterval="2592000000" status="on"> <parameter key="count" value="20"/> <parameter key="consolidationFunction" value="AVERAGE"/> <parameter key="relativeTime" value="YESTERDAY"/> <parameter key="resourceTypeMatch" value="interfaceSnmp"/> <parameter key="attributeMatch" value="ifInOctets"/> </packageReport> </package> <report name="TopN" class-name="org.opennms.netmgt.dao.support.TopNAttributeStatisticVisitor"/> </statistics-daemon-configuration>
- Package Name
<package name="example1">
A package contains a collection of reports. There may be multiple packages. Names should be unique.
- Filter
<filter>nodeLabel LIKE '%mynodes%'</filter>
Only data for nodes that match the filter rule will be examined when producing the reports in this package. The example filter matches all nodes containing the word mynodes in the nodeLabel. For more information see Filters.
- Package Report
<packageReport name="TopN" description="Top 20 ifInOctets across mynodes"
schedule="0 20 1 * * ?" retainInterval="2592000000"
status="on">
The packageReport tag defines an individual report.
name="TopN" defines a name for the report.
description="Top 20 ifInOctets across mynodes" describes the report. This description is used for identifying the report on the OpenNMS Statistics Reports web page.
schedule="0 20 1 * * ?" is a cron-like statement that defines when to create the report. See http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html for more information.
retainInterval="2592000000" defines how long to keep the report, in milliseconds. (2592000000 = 30 days.)
status="on" means that report generation is enabled.
- Parameters
Package report parameters supply additional information needed for report generation.
<parameter key="count" value="20"/>
specifies the value for N in topN. In this example we will get the top 20.
<parameter key="consolidationFunction" value="AVERAGE"/>
This parameter means that the data will be averaged over the collection period.
<parameter key="relativeTime" value="YESTERDAY"/>
This is a predefined time period that means look at the data for the previous day. Other predefined values recently added are "LASTSEVENDAYS" and "LASTTHIRTYONEDAYS".
<parameter key="resourceTypeMatch" value="interfaceSnmp"/>
defines the resource type, nodeSnmp for node-level data or interfaceSnmp for interface data. If the data is collected using some other resourceType, then use the resourceType name as the value.
<parameter key="attributeMatch" value="ifInOctets"/>
specifies the data source for the report.
- Optional Parameters
Optional parameters can be added for additional control. For example, the following optional parameters limit the report to 100 megabit interfaces.
<parameter key="resourceAttributeKey" value="ifSpeed"/> <parameter key="resourceAttributeValueMatch" value="100000000"/>
- Report Name
<report name="TopN" class-name="org.opennms.netmgt.dao.support.TopNAttributeStatisticVisitor"/>
The report name tag associates a report generating class with the report name. Allowable classes are TopNAttributeStatisticVisitor and BottomNAttributeStatisticVisitor.
Report Viewing
To see a list of reports in the OpenNMS web interface, follow the links to Home / Report / Statistics Reports. This page shows a list of all saved reports, giving the report description, start and end dates, and min and max values. Columns can be sorted in ascending or descending order by clicking on the column header.
To see an individual report, click on the report description. There you will see the TopN resources for the report along with the values. Links are available to take you to the node pages and graph pages for each resource.






