Page 1 of 1

Whoops! Error: Could not read host and service

Posted: Sun Jun 17, 2018 8:58 pm
by yomiko
My server (RHEL 7) is installed with nagios-4.3.4 from the default rpm.

However, I placed the conf files (etc/nagios, var/nagios, var/run, var/log) in my
application home directory. I have added user "apache" to my app group in /etc/group.

Apache module is installed.

Nagios service is running. Apcahe server is running.

Issues

1) When I went to the browser (http://<host.myhost.com>:8080/nagios/, it said "x not running".
2) Also, clicking on the links on the side (e.g. Hosts) returned

Code: Select all

Whoops! Error: Could not read host and service status information!
Error: Could not read object configuration data!
Here are some things you should check in order to resolve this error:
Verify configuration options using the -v command-line option to check for errors.
Check the Nagios log file for messages relating to startup or status data errors.
The /var/log/httpd error logs returned

Code: Select all

... autoindex:error] [pid 3436] [client xxxx] AH01276: Cannot serve directory /usr/share/nagios/html/images/: No matching DirectoryIndex (index.html,index.html.var,index.cgi,index.pl,index.php,index.xhtml,index.php) found, and server-generated directory index forbidden by Options directive
/var/log/messages returned

Code: Select all

... <hostname> nagios: job 1 (pid=xxxx): read() returned error 11

So, looks like apache wasn't able access the proper nagios settings/pid, etc?
I think it is a permission issue somewhere.
selinux is disabled.



Any help to troubleshoot this issue is appreciated.


Excerpt from my /etc/httpd/conf.d/<hostname>.conf

Re: Whoops! Error: Could not read host and service

Posted: Mon Jun 18, 2018 3:53 pm
by yomiko
Fixed:

Apache does not know the location of the cgi.cfg since it's not in the default location as expected by Nagios.
Added env var NAGIOS_CGI_CONFIG with the new location.

See
https://assets.nagios.com/downloads/nag ... igcgi.html

Re: Whoops! Error: Could not read host and service

Posted: Mon Jun 18, 2018 4:22 pm
by scottwilkerson
Glad to hear you got it resolved.

Locking