HTTP detector does not use GET method
Description
Acceptance / Success Criteria
None
Lucidchart Diagrams
Activity
Show:
Details
Assignee
UnassignedUnassignedReporter
Marcel FuhrmannMarcel FuhrmannLabels
Components
Affects versions
Priority
Minor
Details
Details
Assignee
Unassigned
UnassignedReporter

Labels
Components
Affects versions
Priority
PagerDuty
PagerDuty Incident
PagerDuty
PagerDuty Incident
PagerDuty

PagerDuty Incident
Created January 16, 2020 at 1:35 PM
Updated March 2, 2020 at 4:30 PM
The detector is not working as suspected:
<detector name="AlertManager" class="org.opennms.netmgt.provision.detector.simple.HttpDetector"> <parameter key="checkRetCode" value="true"/> <parameter key="maxRetCode" value="200"/> <parameter key="port" value="9093"/> <parameter key="url" value="/#/alerts"/> </detector>
The log is complaining about response code mismatch. If you check it with curl you can see the difference:
curl http://172.21.70.154:9093/#/alerts -I -X GET HTTP/1.1 200 OK Accept-Ranges: bytes Cache-Control: no-cache, no-store, must-revalidate Content-Length: 1314 Content-Type: text/html; charset=utf-8 Expires: 0 Last-Modified: Thu, 01 Jan 1970 00:00:01 GMT Pragma: no-cache Date: Thu, 16 Jan 2020 12:34:35 GMT
vs
curl http://172.21.70.154:9093/#/alerts -I HTTP/1.1 405 Method Not Allowed Allow: GET, OPTIONS Content-Type: text/plain; charset=utf-8 X-Content-Type-Options: nosniff Date: Thu, 16 Jan 2020 12:34:38 GMT Content-Length: 19
So it seems the detector is not using the GET method properly.
When I remove this part from the configuration:
<parameter key="checkRetCode" value="true"/> <parameter key="maxRetCode" value="200"/>
The detector detects the service.