Page 1 of 1

Apache cannot read host and service status

Posted: Thu Jan 24, 2019 6:32 pm
by Myztikal
Hi,

I've completed a fresh install of Nagios using the RPM EPEL repositories for Red Hat however i'm running into the following issues:

1) Home page has cross and message "Unable to get process status"
2) Services, Hosts groups (and others) page has the error "Whoops! Error: Could not read host and service status information!"

System information:
OS: RHEL 7.5 (Maipo)
Nagios version: Nagios core 4.3.4 from EPEL

Troubleshooting information:
1) Nagios starts up fine with "systemctl start nagios"
2) No errors found in config
Nagios Core 4.3.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2017-08-24
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 8 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check


No errors in Apache.

I increased the logging level of Nagios but there was no obvious errors.

Re: Apache cannot read host and service status

Posted: Fri Jan 25, 2019 3:56 pm
by tgriep
Is there some sort of policy that is not allowing the nagios process from accessing files / folders?
When you authenticate to the GUI, what user account are you using?
Do you see any errors in the Apache log files

Can you run the following commands as root and post the output to the ticket?

Code: Select all

chage -l nagios
grep nag /etc/group
ls -l /usr/local/nagios/var
ps -ef --cols=300
Also, post the /usr/local/nagios/etc/nagios.cfg file and the /usr/local/nagios/etc/cgi.cfg file.

Re: Apache cannot read host and service status

Posted: Mon Jan 28, 2019 5:58 pm
by Myztikal
Thanks for the assistance:

chage -l nagios
< no user>

grep nag /etc/group
<nothing>

ls -l /usr/local/nagios/var
No such file or directory.

I think this is what you're looking for?
[22:55] root@nmsrsv07 nagios # pwd
/var/log/nagios
[22:55] root@server01 nagios # ls
archives nagios.log retention.dat status.dat



ps -ef --cols=300
(See attached)

Re: Apache cannot read host and service status

Posted: Tue Jan 29, 2019 3:18 pm
by tgriep
When you ran the chage and the grep nag commands, it did not show the nagios user account and group are setup on the server, as well as the missing /usr/local/nagios/var folder, I feel the install did not work.
Can you remove and reinstall the package and show the output when you re-install it?

Re: Apache cannot read host and service status

Posted: Wed Jan 30, 2019 12:44 am
by Myztikal
Attached is the file after running

"sudo yum install nagios"

Also, it may be because we have a user called "nagios" registered to our IPA server (Red Hat's identity management server) but there's a user still there

Re: Apache cannot read host and service status

Posted: Wed Jan 30, 2019 9:13 am
by tgriep
The re-install did not show any errors so can you run these commands again to see if the account was setup, and the folders, etc...?

Code: Select all

chage -l nagios
grep nag /etc/group
ls -l /usr/local/nagios/var
ps -ef --cols=300

Re: Apache cannot read host and service status

Posted: Wed Jan 30, 2019 6:49 pm
by Myztikal
Output of the commands looks the same (see attached)

I know installing via the source code does not have the same issues.

Re: Apache cannot read host and service status

Posted: Thu Jan 31, 2019 2:42 pm
by tgriep
I don't have access to a Clean Redhat 7 system to test it out but I did install Nagios on a Centos7 system and it installed everything and it functioning normally.
I would suspect that there is a policy that the polkitd daemon is enforcing on your server and it not allowing the install to create the users, groups etc....
Tale a look at the /var/log/secure file to see if it is blocking the install of Nagios Core.