Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-4445

HTTP Collector throwing exception "Host must be set to create a host URL"

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.8.9
    • Fix Version/s: Backlog
    • Component/s: Data Collection - HTTP
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Environment:
      CentOS 5.5

      Description

      The following stack trace is being logged in collectd.log when attempting to use a HTTP Collector.

      2011-02-17 18:24:38,361 ERROR [CollectdScheduler-50 Pool-fiber2] CollectableService: An undeclared throwable was caught during data collection for interface <ip-address>/Apache-Stats
      org.opennms.netmgt.collectd.CollectionException: An undeclared throwable was caught during data collection for interface <ip-address>/Apache-Stats
      at org.opennms.netmgt.collectd.CollectableService.doCollection(CollectableService.java:408)
      at org.opennms.netmgt.collectd.CollectableService.run(CollectableService.java:314)
      at org.opennms.netmgt.scheduler.LegacyScheduler$1.run(LegacyScheduler.java:295)
      at org.opennms.core.concurrent.RunnableConsumerThreadPool$FiberThreadImpl.run(RunnableConsumerThreadPool.java:427)
      at java.lang.Thread.run(Thread.java:636)
      Caused by: java.lang.IllegalStateException: Host must be set to create a host URL
      at org.apache.commons.httpclient.HostConfiguration.getHostURL(HostConfiguration.java:316)
      at org.opennms.netmgt.collectd.HttpCollector.persistResponse(HttpCollector.java:466)
      at org.opennms.netmgt.collectd.HttpCollector.doCollection(HttpCollector.java:253)
      at org.opennms.netmgt.collectd.HttpCollector.access$000(HttpCollector.java:98)
      at org.opennms.netmgt.collectd.HttpCollector$HttpCollectionSet.collect(HttpCollector.java:173)
      at org.opennms.netmgt.collectd.HttpCollector.collect(HttpCollector.java:132)
      at org.opennms.netmgt.collectd.CollectionSpecification.collect(CollectionSpecification.java:277)
      at org.opennms.netmgt.collectd.CollectableService.doCollection(CollectableService.java:380)
      ... 4 more

      I have replaced the IP address with <ip-address> in this bug for privacy. Below is an excerpt from http-datacollection-config.xml

      <http-collection name="Apache-Stats">
      <rrd step="300">
      <rra>RRA:AVERAGE:0.5:1:8928</rra>
      <rra>RRA:AVERAGE:0.5:12:8784</rra>
      <rra>RRA:MIN:0.5:12:8784</rra>
      <rra>RRA:MAX:0.5:12:8784</rra>
      </rrd>
      <uris>
      <uri name="apache">
      <url path="/server-status/?auto"
      user-agent="Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/412 (KHTML, like Gecko) Safari/412"
      matches="(?s).?Total\sAccesses:\s([0-9]).?Total\skBytes:\s([0-9]).?CPULoad:\s([0-9\.]).?Uptime:\s([0-9]).?ReqPerSec:\s([0-9\.]).?BytesPerSec:\s([0-9\.]).?BytesPerReq:\s([0-9\.]).?BusyWorkers:\s([0-9]).?IdleWorkers:\s([0-9]+)." response-range="100-399" >
      </url>
      <attributes>
      <attrib alias="TotalAccesses" match-group="1" type="gauge32"/>
      <attrib alias="TotalkBytes" match-group="2" type="gauge32"/>
      <attrib alias="CPULoad" match-group="3" type="gauge32"/>
      <attrib alias="Uptime" match-group="4" type="gauge32"/>
      <attrib alias="ReqPerSec" match-group="5" type="gauge32"/>
      <attrib alias="BytesPerSec" match-group="6" type="gauge32"/>
      <attrib alias="BytesPerReq" match-group="7" type="gauge32"/>
      <attrib alias="BusyWorkers" match-group="8" type="gauge32"/>
      <attrib alias="IdleWorkers" match-group="9" type="gauge32"/>
      </attributes>
      </uri>
      </uris>
      </http-collection>

      And below is the config from capsd-configuration.xml:

      <protocol-plugin protocol="Apache-Stats" class-name="org.opennms.netmgt.capsd.plugins.HttpPlugin" scan="on" user-defined="false">
      <property key="port" value="80" />
      <property key="timeout" value="3000" />
      <property key="retry" value="2" />
      <property key="url" value="/server-status/?auto" />
      </protocol-plugin>

      And from collectd-configuration.xml:

      <service name="Apache-Stats" interval="300000" user-defined="false" status="on" >
      <parameter key="http-collection" value="apache-stats" />
      <parameter key="retry" value="1" />
      <parameter key="timeout" value="2000" />
      </service>

      Thanks
      Paul

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                seth Seth Leger
                Reporter:
                pvitty Paul Vitty
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: