GatewayTimeout when pulling Availability report over 3 month

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

GatewayTimeout when pulling Availability report over 3 month

Post by nagmoto »

Hi

On my 4.1.1 and 4.2.4 Nagios server, I can generate 3 months availability report for two months period,
using custom report period. But when I try over 3 months, I am getting following error message.

Code: Select all

Gateway Timeout
The gateway did not receive a timely response from the upstream server or application.
Following attempt to increase php socket timeout from 60 to 600 seconds didn't help either.

Code: Select all

[nagios@nagios03 ~]$ sudo grep ^default_socket  /etc/php.ini
default_socket_timeout = 600
[nagios@nagios03 ~]$
In attached screenshot, 07/2016 to 10/2016 will failed with timeout while 07/2016 to 09/2016 period is ok.
Attachments
step3.png
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: GatewayTimeout when pulling Availability report over 3 m

Post by avandemore »

Did you restart Apache after making the change?
Previous Nagios employee
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

Re: GatewayTimeout when pulling Availability report over 3 m

Post by nagmoto »

Yes. I restarted both nagios and httpd.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: GatewayTimeout when pulling Availability report over 3 m

Post by avandemore »

To confirm, you are now seeing this error after 10 minutes of waiting?
Previous Nagios employee
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

Re: GatewayTimeout when pulling Availability report over 3 m

Post by nagmoto »

I think it is shorter than 10 minutes until I got time out.
Will this timeout got logged somewhere in the file ?
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

Re: GatewayTimeout when pulling Availability report over 3 m

Post by nagmoto »

I timed it, it was about 2 minutes.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: GatewayTimeout when pulling Availability report over 3 m

Post by avandemore »

What is the output of:

Code: Select all

# grep -R Timeout /etc/httpd/*
Previous Nagios employee
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

Re: GatewayTimeout when pulling Availability report over 3 m

Post by nagmoto »

Masked log entry in /etc/httpd/logs/ssl_error_log

Code: Select all

[Tue Dec 20 13:26:34.488692 2016] [cgi:warn] [pid 27346] [client 192.168.1.150:55445] AH01220: Timeout waiting for output from CGI script /usr/lib64/nagios/cgi/avail.cgi, referer: https://nagios03.test.com/nagios/cgi-bin/avail.cgi?get_date_parts=&host=all
[root@nagios03 ~]#
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: GatewayTimeout when pulling Availability report over 3 m

Post by avandemore »

In /etc/httpd/httpd.conf please change from:

Code: Select all

#EnableMMAP off
EnableSendfile on
to

Code: Select all

#EnableMMAP off
EnableSendfile on

Timeout 600
Restart Apache and test.
Previous Nagios employee
nagmoto
Posts: 195
Joined: Fri Jan 09, 2015 8:05 am

Re: GatewayTimeout when pulling Availability report over 3 m

Post by nagmoto »

"EnableSendfile on" was on already, I think "Timeout 600" in httpd.conf fixed the timeout issue.
Thanks. Please resolve this issue.
Locked