Error: Could not read host and service status information!

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
Adith
Posts: 3
Joined: Thu Jul 11, 2024 6:04 am

Error: Could not read host and service status information!

Post by Adith »

Hi Team,

Our nagios server was on RHEL 7.9 and we have upgraded our server to RHEL 8 and post that we have installed the latest version of nagios core which is 4.4.14 by following this document.
https://support.nagios.com/kb/article/n ... ce-96.html

Nagios and httpd are running but till nagios console says that is not able to read the hosts and services.

Appreciate the response on this as we have been waiting for a week to get this fixed.

Thanks,
Adith
bbahn
Posts: 172
Joined: Thu Jan 12, 2023 5:42 pm

Re: Error: Could not read host and service status information!

Post by bbahn »

Hello @Adith,

It seems that others have encountered similar issues before here: viewtopic.php?t=57164. I suggest trying the things found there and if you get similar results, it would mean that you are encountering a similar issue (an Apache configuration issue).
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
Adith
Posts: 3
Joined: Thu Jul 11, 2024 6:04 am

Re: Error: Could not read host and service status information!

Post by Adith »

Hello,

I did follow the case the documentation links but the commands for a2enmod are not for RHEL and its for Ubuntu.
I have followed this documentation to install nagios from the scratch after our server was upgraded to RHEL 8. Based on the some of the documentation seen, looks like cgi.cfg is unable to check for the right nagios.cfg.
How can we set the cgi.cfg through apache variables?

Thanks,
Adith
gwesterman
Posts: 143
Joined: Wed Aug 23, 2023 11:29 am

Re: Error: Could not read host and service status information!

Post by gwesterman »

Hi @Adith,

This user encountered this issue because their nagios config file was not in the default location. They resolved it by setting the apache environment variable NAGIOS_CGI_CONFIG to the config file's new location.

Here is some documentation on setting apache environment variables. There is a lot of additional documentation out there if this doesn't work.

If this resolves your issue or if this isn't the cause, please let us know.

Thank you!
Adith
Posts: 3
Joined: Thu Jul 11, 2024 6:04 am

Re: Error: Could not read host and service status information!

Post by Adith »

Hi Team,

The issue was actually that nagios was looking for a different cgi.cfg location which got installed when nagios was installed.
I renamed that cgi and reloaded nagios and got to know from the console that it was pointing towards wrong cgi.
Then I updated the correct path in cgi.cfg and then started to work.

Thank you for all the help
gwesterman
Posts: 143
Joined: Wed Aug 23, 2023 11:29 am

Re: Error: Could not read host and service status information!

Post by gwesterman »

Hi @Adith,

I'm glad you found a solution!

Please reach out if you have any additional questions.

Thank you!
Locked