Data Export

From OpenNMS
Jump to navigation Jump to search

Warning.png This feature is deprecated

The data export servlet feature is deprecated since OpenNMS Horizon 16 in favor of the Measurements ReST Service, and will be removed in a future release.

The Data Export feature that will export performance data stored in the "RRD" files to an XML file that can be used by other application (currently available if you are using JRobin or RRDtool (tested on 1.12.1) to store the data).

This feature is accessed by going to a particular URL (/opennms/summary/results.htm) and passing four parameters:

filterRule
a filter rule This is any filter that normally works in OpenNMS, such as "ipaddr iplike *.*.*.*" (although I'd worry about using that one with a open attributeSieve)
startTime
(in seconds since epoch) i.e. this is in the value returned with "date +%s"
endTime
(in seconds since epoch) same format as startTime
attributeSieve
a regexp that can be passed to String.match() to match the attribute name Thus ".*" would return all values from all RRDs for the nodes that match the filter above.

Examples

Here's an example using wget:

 wget --http-user=admin --http-passwd=admin \
  --auth-no-challenge -O summary.xml \
  'http://172.16.8.100:8980/opennms/summary/results.htm?filterRule=ipaddr+iplike+10.136.123.1&startTime=1184173183&endTime=1185219010&attributeSieve=.*'

This will return the summary.xml file for all of the variables being collected for the node that contains 10.136.123.1. Here's one for ifInOctets and ifOutOctets for the whole system:

 wget --http-user=admin --http-passwd=admin \
  --auth-no-challenge -O summary.xml \
 'http://172.16.8.100:8980/opennms/summary/results.htm?filterRule=ipaddr+iplike+*.*.*.*&startTime=1184173183&endTime=1185219010&attributeSieve=(ifInOctets%7CifOutOctets)'

Time is in miliseconds. When copy&pasting the timestamps from a graph, remove the last 3 digits. Otherwise the values will be NaN.

To get a response in a webbrower:

 http://192.168.1.200:8980/opennms/summary/results.htm?filterRule=ipaddr+iplike+192.168.1.200&startTime=1381829000&endTime=1381915400&attributeSieve=.*
 <summary>
   <resource><name>opennms.massxess.nl</name>
   <attribute></attribute>
   <attribute></attribute>
   <attribute></attribute>
   <resource>
     <name>opennms-jvm (*)</name>
     <attribute>
       <name>ONMSQueSigOpsCompl</name>
       <min>41.67096</min>
       <average>43.57529</average>
       <max>53.92008</max>
     </attribute>

It isn't possible to use &start=end-24h&end=now like with graphs: Looking at the source code of org.opennms.web.controller.RrdSummaryController (especially org.opennms.web.svclayer.SummarySpecification), the controller expect a numeric value for start and end, so technically, that is not going to work.


Keywords: XML, RRD, export, integration, statistics, reporting