Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_http sometimes fails when Transfer-Encoding: chunked is used #1533

Closed
chgarling opened this issue May 9, 2018 · 4 comments · Fixed by #1815
Closed

check_http sometimes fails when Transfer-Encoding: chunked is used #1533

chgarling opened this issue May 9, 2018 · 4 comments · Fixed by #1815

Comments

@chgarling
Copy link

chgarling commented May 9, 2018

Sometimes check_http goes into CRITICAL state when Transfer-Encoding: chunked is used. Then the check fails for a couple of minutes.

We have spent some time with debugging but the response we get from the webserver is always complete. If we choose another string to check the content the check is fine again. So it looks like check_http has a problem with reassembling the chunked response.

We are using nagios-plugins-http-2.2.1-4git.el7.x86_64 on CentOS Linux release 7.4.1708 (Core).

The used command is as followed (anonymized):
check_http -H "www.example.com" -I "192.168.90.107" -c 20 -e 200 -k "https:true" -p 8810 -s "Realisiert mit dem Government Site Builder" -u /Webs/Example/DE/Startseite/startseite_node.html -w 10

The flapping check output looks like this:
HTTP OK: Status line output matched "200" - HTTP/1.1 200 OK - 60925 bytes in 0.005 second response time |time=0.005078s;10.000000;20.000000;0.000000 size=60925B;;;0
HTTP CRITICAL: Status line output matched "200" - HTTP/1.1 200 OK - string 'Realisiert mit dem Governm...' not found on 'http://www.example.com:8810/Webs/Example/DE/Startseite/startseite_node.html' - 71720 bytes in 0.090 second response time |time=0.089791s;10.000000;20.000000;0.000000 size=71720B;;;0

Here you can find two straces that also show the problem:

strace-check_http-s407-8810.gz
strace-check_http-s409-8810.gz

The string is read in the server reply in strace:
"<!--Realisiert mit dem Government Site Builder"

But it still outputs:
write(1, "HTTP CRITICAL: Status line output matched "200" - HTTP/1.1 200 OK - string 'Realisiert mit dem Governm...' not found on 'http://www.example.com:8810/Webs/Example/DE/Startseite/startseite_node.html'

If you need further information, logs or anything else let me know.

Regards, Christian

@waja
Copy link
Member

waja commented May 9, 2018

We are using nagios-plugins-http-2.2.1-4git.el7.x86_64 on CentOS Linux release 7.4.1708 (Core).

This plugins are not our ones but you can ask the guys over there at https://github.com/nagios-plugins/nagios-plugins.

@ChrisSLR
Copy link

We have the same issue with

 check_http v2.2 (monitoring-plugins 2.2)

If a chunk end is within the search string the check will fail because of the hex size information in the response.

One workaround is to use HTTP 1.0 by connecting to the Server using -I and providing the hostname as a -k "host: www.mydomain.com". HTTP 1.0 doesn't support chunks. Because of a bug in the header handling code in check_http it is necessary not to write "Host:". Using "HOST:" or "host:" is ok.

@craig
Copy link

craig commented Jul 15, 2019

Thanks for the hint, the bug is relevant for nagios-plugins and monitoring-plugins. nagios-plugins/nagios-plugins#374

@ekeih
Copy link

ekeih commented Aug 23, 2019

Additionally to a lot of other stuff check_curl solves the chunking issues: #1535

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants