Monitoring a service with HTTP 1.1 but doesn't work with HTTP 2

Hi!

Same check but against two different web-servers.
server1. Receives HTTP/1.1 200 OK = https check works fine in opennms
server2. Receives HTTP/2 200 = https check doesn’t work in opennms

Thanks!

Can you elaborate a bit your use case and goal? Are you talking about monitoring HTTP/2 endpoints or making the OpenNMS servers available via HTTP/2? Which version do you have running, (e.g. OpenJDK, operating system, OpenNMS version)?

Hi!

It’s about a regular HTTPS check towards a IP-endpoint.
I get: “domainname” is up but “unresponsive”
26.1.0

 <service name="HTTPS-api.domain.se-PingTest" interval="60000" user-defined="false" status="on">
     <parameter key="retry" value="2"/>
     <parameter key="timeout" value="10000"/>
     <parameter key="port" value="443"/>
     <parameter key="host-name" value="api.domain.se"/>
     <parameter key="url" value="/api/test"/>
     <parameter key="user" value="user"/>
     <parameter key="password" value="password"/>
     <parameter key="response" value="200"/>
 </service>

What monitor class do you use for the HTTPS-api.domain.se-PingTest? It’s the <monitor service ... line at the end of the poller-configuration.xml.

<monitor service="HTTPS-check" class-name="org.opennms.netmgt.poller.monitors.HttpsMonitor"/>

Ok I assume you use the HttpsMonitor for your HTTPS-api.domain.se-PingTest service as well. The line you have pasted is for a different service test HTTPS-check. It looks like the HttpMonitor which is extended by the HttpsMonitor hard codes the HTTP GET version to 1.1

I would try to convert your test to use the PageSequenceMonitor which allows you to set a http-version described here: Administrators Guide

Doesn’t go up if i use = http-version=“2.0” or http-version=“2”

  <service name="HTTPS-WebCheck-PRO" interval="300000" user-defined="false" status="on">
     <parameter key="sequence-retry" value="2"/>
     <parameter key="timeout" value="8000"/>
     <parameter key="page-sequence">
        <page-sequence xmlns="">
           <page disable-ssl-verification="true" host="${nodelabel}" http-version="2.0" method="GET" path="/" port="443" response-range="200" scheme="https" virtual-host="${nodelabel}" xmlns=""/>
        </page-sequence>
     </parameter>
  </service>
 <monitor service="HTTPS-WebCheck-PRO" class-name="org.opennms.netmgt.poller.monitors.PageSequenceMonitor"/>

It seems that opennms doesen’t support http/2 :frowning:

Which version do you have running, (e.g. OpenJDK, operating system, OpenNMS version)?

opennms 26.1.0
OpenJDK Runtime Environment 18.9
Centos 7.8

http-version HTTP protocol version number, 0.9, 1.0 or 1.1 optional HTTP/1.1

Can you provide the exact output from

$(cat /opt/opennms/etc/java.conf) --version

It tells you which Java environment your OpenNMS is using. It should be something like this here:

openjdk 11.0.9 2020-10-20 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.9+11-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.9+11-LTS, mixed mode, sharing)

Additionally, can check your /opt/opennms/logs/poller.log with errors for your service and share errors for your HTTPS-WebCheck-PRO as svcName.

openjdk 11.0.7 2020-04-14 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.7+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.7+10-LTS, mixed mode, sharing)

Did a grep on “HTTPS-WebCheck-PRO” but didn’t find anything in poller.log
When i do a “opennms -v status” i only get connection refused. When im using http-version=“2”

Please share your service definition from your poller-configuration.xml and run the configuration test command like this:

cd /opt/opennms/bin
./config-tester -a

If you see errors share error outputs. Check /opt/opennms/logs/output.log and /opt/opennms/logs/manager.log for error messages when you try to start the opennms service.

I have shared the definition already from poller.conf it’s further up in the thread. But i found this:

Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 240; cvc-pattern-valid: Value ‘2’ is not facet-valid with respect to pattern ‘1.0|1.1’ for type ‘allowed-versions’.

Internal Exception: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 240; cvc-pattern-valid: Value ‘2’ is not facet-valid with respect to pattern ‘1.0|1.1’ for type ‘allowed-versions’.]; nested exception is javax.xml.bind.UnmarshalException

From the documentaion it says: http-version HTTP protocol version number, 0.9, 1.0 or 1.1 optional HTTP/1.1

Feature request? :wink:

Do you know where i can send a feature req?

Big thanks for your time and help! :slight_smile:

You can open a feature request in our public software management tool JIRA. We would have to verify if the problem still exists in the latest stable release Horizon 27.0.5. Thanks for digging into this problem.

1 Like