Page 1 of 1

Nagios Core Front-End - CGI times out

Posted: Wed Sep 26, 2018 2:32 pm
by Pradeeps
Hello,
I have installed nagios core with nagiosql and loaded few host and services where i have no issues on that part. However when I start increasing the host count, I see cgi/apache times out showing an error.

Code: Select all

The gateway did not receive a timely response from the upstream server or application.
The host count is 5400 right now. I agree its huge and suspect there should be some tuning required to allow this much load but not sure where I should check. Any help would be helpful.

Here is the http error message I see whenever the frontend times out.

Code: Select all

[Wed Sep 26 19:23:24.052554 2018] [autoindex:error] [pid 43461] [client 127.0.0.1:41694] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Wed Sep 26 19:27:37.002290 2018] [cgi:warn] [pid 12255] [client 192.168.199.254:37478] AH01220: Timeout waiting for output from CGI script /usr/local/nagios/sbin/statusjson.cgi, referer: http://192.168.199.24/nagios/main.php
[Wed Sep 26 19:27:37.002368 2018] [cgi:error] [pid 12255] [client 192.168.199.254:37478] Script timed out before returning headers: statusjson.cgi, referer: http://192.168.199.24/nagios/main.php
[Wed Sep 26 19:27:38.156480 2018] [cgi:warn] [pid 5266] [client 192.168.199.254:29592] AH01220: Timeout waiting for output from CGI script /usr/local/nagios/sbin/tac.cgi, referer: http://192.168.199.24/nagios/side.php
[Wed Sep 26 19:27:38.156555 2018] [cgi:error] [pid 5266] [client 192.168.199.254:29592] Script timed out before returning headers: tac.cgi, referer: http://192.168.199.24/nagios/side.php

Re: Nagios Core Front-End - CGI times out

Posted: Wed Sep 26, 2018 3:20 pm
by mcapra
Which version of Nagios Core did you install? What instructions did you use to install it?

What sort of resources does this machine have available to it?

You could bump up the TimeOut directive of your main Apache config file to see if it returns at all -- even if it takes a while.

Many of the reports are getting big overhauls in Nagios Core 5, though that doesn't have a release date on the official roadmap yet.

Re: Nagios Core Front-End - CGI times out

Posted: Wed Sep 26, 2018 4:10 pm
by Pradeeps
I am running on Nagios core - version 4.4.2
I followed this link for core installation.

https://assets.nagios.com/downloads/nag ... entos7.pdf

I also tried increasing the timeout to 90 seconds on httpd.conf but that doesnt help. Again this is the issue only when I add more host. I tried removing half of them and it started working normally.

Re: Nagios Core Front-End - CGI times out

Posted: Thu Sep 27, 2018 10:17 am
by lmiltchev
What sort of resources does this machine have available to it?
Can you answer this?

Also, post the httpd.conf, nagios.conf, and php.conf files.

Re: Nagios Core Front-End - CGI times out

Posted: Tue Oct 02, 2018 11:48 am
by Pradeeps
Sorry for the delayed response. I have increased the timeout on http.conf and it started working. However, for some reason when i hit "Restart Nagios" from nagiosql, it saye "Nagios daemon is not running, cannot send restart command!" but looking through cli its running. Not sure why its showing like this.

Re: Nagios Core Front-End - CGI times out

Posted: Tue Oct 02, 2018 1:36 pm
by lmiltchev
What do you see when you try to restart nagios from the command line?

Code: Select all

service nagios restart
Do you see any error messages, similar to this one?
Running configuration check... Stopping nagios: No lock file found in /var/run/nagios
Starting nagios: Running configuration check... done.
If you do, you may need to modify the nagios.cfg file. For more info on the topic, see the KB article below:

https://support.nagios.com/kb/article/n ... s-796.html

Re: Nagios Core Front-End - CGI times out

Posted: Tue Oct 02, 2018 2:37 pm
by Pradeeps
There was a mismatch in lock file location. I have fixed it and restarted nagios and it worked.

Re: Nagios Core Front-End - CGI times out

Posted: Tue Oct 02, 2018 2:51 pm
by lmiltchev
I am glad I was able to help! :)

I will be locking this topic now. If you have any further questions, please start a new thread.