Whoops! Error: Could not read host and service

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
yomiko
Posts: 22
Joined: Mon Aug 21, 2017 6:45 pm

Whoops! Error: Could not read host and service

Post 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
Attachments
myhost.conf
(781 Bytes) Downloaded 707 times
yomiko
Posts: 22
Joined: Mon Aug 21, 2017 6:45 pm

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

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post by scottwilkerson »

Glad to hear you got it resolved.

Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked