HttpCollector

The HttpCollector collects performance data via HTTP and HTTPS. Attributes are extracted from the HTTP responses using a regular expression.

Collector Facts

Class Name

org.opennms.netmgt.collectd.HttpCollector

Package

core

Supported on Minion

Yes

Collector Parameters

Use these parameters in the collectd-configuration.xml file.

Table 1. Collector-specific parameters for the HttpCollector
Parameter Description Required Default value

collection

The name of the HTTP Collection to use.

required

(none)

thresholding-enabled

Whether collected performance data should be tested against thresholds.

optional

true

port

Override the default port in all of the URIs

optional

80

timeout

Connection and socket timeout in milliseconds

optional

3000

retry

Number of retries

optional

2

use-system-proxy

Should the system-wide proxy settings be used? Configure system proxy settings via system properties

optional

false

HTTP Collection Configuration

Understanding resource types helps when editing collector-specific configuration files.

Define HTTP Collections in etc/http-datacollection-config.xml.

This snippet provides a collection definition named opennms-copyright:

<http-collection name="opennms-copyright">
  <rrd step="300">
    <rra>RRA:AVERAGE:0.5:1:2016</rra>
    <rra>RRA:AVERAGE:0.5:12:1488</rra>
    <rra>RRA:AVERAGE:0.5:288:366</rra>
    <rra>RRA:MAX:0.5:288:366</rra>
    <rra>RRA:MIN:0.5:288:366</rra>
  </rrd>
  <uris>
    <uri name="login-page">
      <url path="/opennms/login.jsp"
           matches=".*2002\-([0-9]+).*" response-range="100-399" dotall="true" >
      </url>
      <attributes>
        <attrib alias="copyrightYear" match-group="1" type="gauge"/>
      </attributes>
    </uri>
  </uris>
</http-collection>

Once added to etc/http-datacollection-config.xml you can test it using the collect command available in the Karaf Shell:

opennms:collect org.opennms.netmgt.collectd.HttpCollector 127.0.0.1 collection=opennms-copyright port=8980