Welcome to Questions - Ask OpenNMS, where you can ask questions and receive answers from other members of the community.

HTTP Collector appends "?" to URL causing query to fail

0 votes
22 views

OpenNMS’ HTTP collector is appending a “?” to URLs which causes the query to fail.  See question http://ask.opennms.eu/?qa=1093/http-collector-changing-http-get-to-query for additional information including complete xml and log files.

The URI fragment of the http-datacollection-config.xml:

        <uris>
          <uri name="HTTP-1wire">
              <url path="/bus.0/28.22619B080000/fasttemp"
                 matches="(?s).*?fasttemp.*?<TD>([0-9\.]+).*"
                 response-range="-100-399">
              </url>
            <attributes>
              <attrib alias="OWTemperature" match-group="1" type="gauge32"/>
            </attributes>
          </uri>
        </uris>

The collectd.log file shows the query with the trailing “?” and the resulting failure (lines trimmed for readability):

[...] o.a.h.headers: http-outgoing-2 >> GET /bus.0/28.22619B080000/fasttemp? HTTP/1.1
[...] o.a.h.headers: http-outgoing-2 >> Host: 10.0.3.181:2121
[...] o.a.h.headers: http-outgoing-2 >> Connection: Keep-Alive
[...] o.a.h.headers: http-outgoing-2 >> User-Agent: Apache-HttpClient/4.3.6 (java 1.5)
[...] o.a.h.headers: http-outgoing-2 >> Accept-Encoding: gzip,deflate
[...] o.a.h.wire: http-outgoing-2 >> "GET /bus.0/28.22619B080000/fasttemp? HTTP/1.1[\r][\n]"
[...] o.a.h.wire: http-outgoing-2 >> "Host: 10.0.3.181:2121[\r][\n]"
[...] o.a.h.wire: http-outgoing-2 >> "Connection: Keep-Alive[\r][\n]"
[...] o.a.h.wire: http-outgoing-2 >> "User-Agent: Apache-HttpClient/4.3.6 (java 1.5)[\r][\n]"
[...] o.a.h.wire: http-outgoing-2 >> "Accept-Encoding: gzip,deflate[\r][\n]"
[...] o.a.h.wire: http-outgoing-2 >> "[\r][\n]"
[...] o.a.h.wire: http-outgoing-2 << "HTTP/1.0 400 Bad Request[\r][\n]"
[...] o.a.h.wire: http-outgoing-2 << "Date: Thu, 02 Feb 2017 02:25:10 GMT[\n]"
[...] o.a.h.wire: http-outgoing-2 << "Server: owhttpd[\r][\n]"
[...] o.a.h.wire: http-outgoing-2 << "Last-Modified: Thu, 02 Feb 2017 02:25:10 GMT[\r][\n]"
[...] o.a.h.wire: http-outgoing-2 << "Content-Type: text/html[\r][\n]"
[...] o.a.h.wire: http-outgoing-2 << "[\r][\n]"

The question is, why is OpenNMS appending the “?” to the URL?  The URL path is /bus.0/28.22619B080000/fasttemp.  What causes the “?” and how to prevent it?

--Larry

 

OpenNMS version
18.0.3
Java version
1.8.0_121
Operating system
Ubuntu 16.04
PostgreSQL version
9.5
asked Mar 6 by fahnoe (150 points)

Please log in or register to answer this question.

...