Check_http lost http2 support in version 2.2

Upgrading from check_mk 2.1 (raw) to check_mk 2.2 we lost http2 support in shipped check_http.
Our check connects to our monitored server and checks if a redirect (302) is sent back, which is OK.
This worked in 2.1.
With 2.2 the check returns an error (Return code of 139 is out of bounds)

Can you share your exact check_http command?

check_mk_active-http!–ssl --onredirect=ok --extended-perfdata --sni -I ‘$_HOSTADDRESS_4$’ -H my.server.name

A quick workaround might be to use the Nagios check_http check instead.
Create a rule for Integrate Nagios plugins and use check_http

Details and parameter at: Nagios check_http Plugin

Thank you for this hint.
Using check_http I found the problem: “Transfer-Encoding: chunked”

check_http -H my.server.name --ssl --sni -v

showed me:

STATUS: HTTP/1.1 302 Found
**** HEADER ****
Server: nginx
Date: Tue, 06 Jun 2023 12:24:12 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: close
...
**** CONTENT ****
0

Found chunked content
Segmentation fault (core dumped)

But in my case it worked, omitting the -H option
So I returned to the original check_mk solution, using

check_mk_active-http!-u /checkmk --ssl --onredirect=ok --extended-perfdata --sni -I ‘$_HOSTADDRESS_4$’

This worked.

curl -I https://my.server.name/ has no problem with the chunked content. Maybe it would be a possible solution, to use curl internally in the check

2 Likes

our environment is an “Ilias” (e-learning) server, (php, nginx) which redirects unauthenticated user to an OAuth2 server.

I set up another simple webserver with http2, https and name-based virtual hosts (sni), without Transfer-Encoding: chunked and configured a http check in check_mk, like

check_mk_active-http!–ssl --extended-perfdata --sni -I ‘$_HOSTADDRESS_4$’ -H my.other.server.name

It works perfect.

This issue is solved so far for me. It’s not a http2 problem. Just handling of chunked transfers doesn’t work.

Same problem here with check an nextcloud web interface per https over nginx

Bildschirmfoto 2023-06-21 um 22.15.21

check_mk_active-http!--ssl --sni -I '$_HOSTADDRESS_4$' -H nextcloud.xxxxx.com

Found chunked content
Segmentation fault (core dumped)

Check_MK RAW 2.2.0p3.cre

Still got the same problem with 2.1.0p31.

1 Like

I have the same problem using the latest version of Checkmk for a host on Cloudflare CDN (proxied).

vm-admin:~ # /opt/omd/versions/2.2.0p7.cre/lib/nagios/plugins/check_http --extended-perfdata -L --sni -I hockeyjunior.ca -H hockeyjunior.ca -v
<A HREF="http://hockeyjunior.ca:80/" target="_blank">GET / HTTP/1.1
User-Agent: check_http/v2.3.3 (monitoring-plugins 2.3.3)
Connection: close
Host: hockeyjunior.ca


http://hockeyjunior.ca:80/ is 666 characters
STATUS: HTTP/1.1 301 Moved Permanently
**** HEADER ****
Date: Wed, 16 Aug 2023 03:14:34 GMT
Transfer-Encoding: chunked
Connection: close
Cache-Control: max-age=3600
Expires: Wed, 16 Aug 2023 04:14:34 GMT
Location: https://hockeyjunior.ca/
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=u%2FM8hR9SteXQMKcj4yhmG8WuNMLtBBRFqUKCEpI2UeGCRfwySTg4G6%2FqdMbIVgjo5lGt4UEMJBPtqpM24yDbeT9LR9HA8lb99TQllyszRB0XeiWYu7tapd%2BXrGspyfDDlJY%3D"}],"group":"cf-nel","max_age":604800}
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
X-Content-Type-Options: nosniff
Server: cloudflare
CF-RAY: 7f7682035de34bbe-YUL
alt-svc: h3=":443"; ma=86400
**** CONTENT ****
0


Found chunked content
Segmentation fault (core dumped)

Without the -H however I get a HTTP 400 Bad Request response from Cloudflare so that is not a solution for me. No issues with curl, I get the 301 response and the new Location which is the same website but with HTTPS. I still want to monitor the redirection on port 80 in case anyone types http manually in their browser.

For anyone having the same issue…

Just follow the redirection…

vm-admin:~ # /opt/omd/versions/2.2.0p7.cre/lib/nagios/plugins/check_http -H hockeyjunior.ca -I hockeyjunior.ca -f follow --sni
HTTP OK: HTTP/1.1 200 OK - 21443 bytes in 0.287 second response time |time=0.287039s;;;0.000000;10.000000 size=21443B;;;0;
1 Like