Nagios Core Front-End - CGI times out

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.
Locked
Pradeeps
Posts: 38
Joined: Thu Dec 22, 2016 11:05 am

Nagios Core Front-End - CGI times out

Post 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
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios Core Front-End - CGI times out

Post 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.
Former Nagios employee
https://www.mcapra.com/
Pradeeps
Posts: 38
Joined: Thu Dec 22, 2016 11:05 am

Re: Nagios Core Front-End - CGI times out

Post 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.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Core Front-End - CGI times out

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Pradeeps
Posts: 38
Joined: Thu Dec 22, 2016 11:05 am

Re: Nagios Core Front-End - CGI times out

Post 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.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Core Front-End - CGI times out

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Pradeeps
Posts: 38
Joined: Thu Dec 22, 2016 11:05 am

Re: Nagios Core Front-End - CGI times out

Post by Pradeeps »

There was a mismatch in lock file location. I have fixed it and restarted nagios and it worked.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Core Front-End - CGI times out

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked