Page 1 of 1

check_http - long response time

Posted: Tue Jul 25, 2023 7:02 am
by stevanovic
Hello,

I have a problem with http(s) checks.
I am using Nagios Core(version 4.4.9) with check_http plugin version 2.3.3 for monitoring websites on the web server.
A few weeks ago issues started with long response times for some websites (not all sites on that server).
Nagios reporting critical error for response time longer than 15 seconds.
After 1-2 minutes error state is going back to OK and response time of a website is about 0.012 seconds.

Errors looks like this:
HTTP CRITICAL: HTTP/1.1 302 Found - 563 bytes in 17.173 second response time

Things I've tried but didn't fix the issue:
-adding -f follow
-adding -N ( for content)
-updating nagios and all plugins on the newest version
-checking firewall on both servers

Nagios and the web server are in the same location, so it is unclear why it reports high response times or what else could be done to stop these errors

Re: check_http - long response time

Posted: Tue Aug 15, 2023 9:46 am
by Butters
have you tried mtr the target host if you see any drops/loss?
is there any name resolution problems in place ?
when you run it manually is it always responding slow?

Re: check_http - long response time

Posted: Tue Aug 15, 2023 11:20 am
by swolf
Hi @stevanovic, thanks for reaching out.

Similar to what @Butters said, I wouldn't assume that check_http is wrong here - it's much more likely that your web server has some increased load or background job that contends for systems resources, slowing down your requests. I would try to confirm the behavior out-of-band first.

If the degraded performance window is only 1-2 minutes it's a little harder, but I would just have a terminal open on the Nagios Core server that runs curl in a loop, and reports the current timestamp and how long it took to make whatever specific request. You should then be able to figure out if you can correlate degraded performance via cURL to degraded performance via nagios. If those timestamps match, it's definitely something outside of the Nagios Core server.

Hopefully that helps. Please let us know if you have any futher questions or concerns.

-Sebastian Wolf