if used like before (i.e. "/foo") then just work like always
if entered in format of host:/foo, then it will send a host header with the request
url = "acme.org:/foo" will result in this request:
GET /foo HTTP 1.0 Host: acme.org
Then one just have to copy up the HTTP poller class and add the right bits, like so: <service name="HTTP-acme.org" interval="300000" user-defined="false" status="on"> <parameter key="retry" value="1" /> <parameter key="timeout" value="3000" /> <parameter key="port" value="80" /> <parameter key="url" value="/foo" /> <parameter key="host-name" value="acme.org"/> <parameter key="rrd-repository" value="/var/lib/opennms/rrd/response" /> <parameter key="rrd-base-name" value="http-acme.org" /> <parameter key="ds-name" value="http-acme.org" /> </service>
Acceptance / Success Criteria
None
Lucidchart Diagrams
Activity
Show:
Alexander Hoogerhuis July 16, 2011 at 8:00 AM
Because we only had a moment to do it and I don't understand enough of the code to figure out where variables are born and how they interact with the code, so instead of figuring out where variable heaven is, we did this just to see that it could work.
But yes, a host-name variable is a better route.
Benjamin Reed July 16, 2011 at 7:56 AM
Or, a "host-name" parameter, matching the HTTP poller... =)
Benjamin Reed July 16, 2011 at 7:55 AM
I'm confused, why are you overloading url with a hostname which now requires funky parsing, rather than adding a "vhost" parameter?
Small change to HttpDetector.java to make it process the url key slightly different: http://login.boxed.no/~alexh/HttpDetector.java
New semantics of the url parameter is:
if used like before (i.e. "/foo") then just work like always
if entered in format of host:/foo, then it will send a host header with the request
url = "acme.org:/foo" will result in this request:
GET /foo HTTP 1.0
Host: acme.org
Then one just have to copy up the HTTP poller class and add the right bits, like so:
<service name="HTTP-acme.org" interval="300000" user-defined="false" status="on">
<parameter key="retry" value="1" />
<parameter key="timeout" value="3000" />
<parameter key="port" value="80" />
<parameter key="url" value="/foo" />
<parameter key="host-name" value="acme.org"/>
<parameter key="rrd-repository" value="/var/lib/opennms/rrd/response" />
<parameter key="rrd-base-name" value="http-acme.org" />
<parameter key="ds-name" value="http-acme.org" />
</service>