Plugin check_http takes too long to response

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jguzzetti
Posts: 17
Joined: Wed Mar 13, 2019 9:09 am

Plugin check_http takes too long to response

Post by jguzzetti »

Hello!
We are using Nagios XI for monitoring a huge sort of types of checks for lot of services and hosts of Nación Servicios S.A. . One of the groups of checks is all the backend of “Cuándo SUBO”, a mobile app which tells you when a bus is going to be in the bus stop, and we have thousands of users with those apps (Android and iOS platforms).

Recently, we tried to deploy a new http check with the check_http plugin, for a webservice, but we have a critical issue that it seems to be a performance problem of the plugin. We already use the same plugin for others checks of others webservicies and it seems to work fine, but not for this group.

We want to check three methods of the webservice registering the size and response time, but it takes a lot of time to get the response when we use the plugin; but it takes a short time when we call the webservice using wget from shell.

Attacheds, you can see the screenshots with the details of the test we made for one of the methods:
Nagios - UI - Result (timed out).PNG: Check “running” with timed out result, more than 60 seconds.
Nagios - Shell - Using plugin check_http.PNG: Shell execution with the plugin taking 202 seconds.
Nagios - Shell - Without using plugin.PNG: Shell wget execution without plugin taking 0.6 seconds.


By the way, we have another theme, probably an issue:
We found that the graphs always shows amounts with decimals, and that’s not ok, because the result of the sql query we use responds always with integers. We use the “check_mssql_health --mode sql” plugin to count and check the amount of buses transmitting.

We hope you can support us with this problems.
Thank you very much!
Best regards
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Plugin check_http takes too long to response

Post by cdienger »

Try running check_http without the "-m" option and also running it with the "-v" option to see the verbose output. Also, does the site require authentication? If so, you can pass username and password using "-a username:password".

The performance data graphs will sometimes show numbers with decimals and there isn't a good way to avoid this. It's a result of how values are calculated and stored in the rrd databases.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jguzzetti
Posts: 17
Joined: Wed Mar 13, 2019 9:09 am

Re: Plugin check_http takes too long to response

Post by jguzzetti »

I run the plugin just like you said, without the -m and aggregating -v to verbose output. The webservice doesn't require authentication. Here is the output:
HTTP CRITICAL: HTTP/1.1 200 OK - 40705158 bytes in 239.829 second response time |time=239.828581s;45.000000;60.000000;0.000000 size=40705158B;;;0 time_connect=0.001923s;;; time_headers=0.000014s;;; time_firstbyte=1.720260s;;; time_transfer=239.826502s;;;
Request:
GET http://xxxxxxxxxxxxxxxxxxx.xxxxxxxxx.xx ... xxx?json=1 HTTP/1.0
User-Agent: check_http/v2.2.1 (nagios-plugins 2.2.1)
Connection: close
Accept: */*
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Plugin check_http takes too long to response

Post by cdienger »

It may be related to the HTTP/1.0 protocol that is being used. We can change this in the binary as a test. Please provide me a copy of the /usr/local/nagios/libexec/check_http and I can provide a modified plugin for you to test with.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jguzzetti
Posts: 17
Joined: Wed Mar 13, 2019 9:09 am

Re: Plugin check_http takes too long to response

Post by jguzzetti »

Great! Here you´ve got the binary.
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Plugin check_http takes too long to response

Post by cdienger »

Attached modified plugin. Run it with the same options as the previous attempt.
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jguzzetti
Posts: 17
Joined: Wed Mar 13, 2019 9:09 am

Re: Plugin check_http takes too long to response

Post by jguzzetti »

Anyway, it tooks a lot of time.
HTTP CRITICAL: HTTP/1.1 200 OK - 37731158 bytes in 206.706 second response time |time=206.705544s;45.000000;60.000000;0.000000 size=37731158B;;;0
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Plugin check_http takes too long to response

Post by cdienger »

I'd like to get a capture of the traffic as you run the curl command and the plugin. From the command line run:

Code: Select all

tcpdump -s 0 -i any host w.x.y.z -w output.pcap
w.x.y.z is the IP address of the web server. Then run the curl command followed by the check_http command on another terminal session. You only need to let the check_http command run 5-10 seconds before using CTRL+C to stop the tcpdump. Please zip and PM me the output.pcap file this creates.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jguzzetti
Posts: 17
Joined: Wed Mar 13, 2019 9:09 am

Re: Plugin check_http takes too long to response

Post by jguzzetti »

I send to you the output attached.
You do not have the required permissions to view the files attached to this post.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: Plugin check_http takes too long to response

Post by mbellerue »

Could you try adding these flags to your wget command and tell us if the command takes a long time to process?

Code: Select all

--header="Connection: Keep-Alive" --useragent="Wget/1.14 (linux-gnu)"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked