Page 1 of 2
Reading Configuration File
Posted: Mon Apr 10, 2017 11:47 am
by jcooper
New server have only configured a few things.
When I log in as nagiosadmin I get the error 'Error: Could not read object configuration data!"
I've verified the configuration files and they seem legit.
It acts as though nagiosadmin doesn't have permission to view the config file. Where can I check this?
OS: Ubuntu 16.2
Nagios Core 4.3.1
Appreciate the help!
Re: Reading Configuration File
Posted: Mon Apr 10, 2017 1:16 pm
by avandemore
You can see file permissions by doing a:
Nagios Core configuration usually starts with a file named nagios.cfg which references other configuration files.
Re: Reading Configuration File
Posted: Tue Apr 11, 2017 7:08 am
by jcooper
Output:
root@server:~# la -la /usr/local/nagios/etc/nagios.cfg
-rw-rw-r-- 1 nagios nagios 44879 Apr 6 14:19 /usr/local/nagios/etc/nagios.cfg
Nagios admin doesn't show up as I believe it's due to it being set up as an apache2 user?
Any help is greatly appreciated!
Re: Reading Configuration File
Posted: Tue Apr 11, 2017 9:22 am
by tacolover101
is your apache user in the nagios group?
Re: Reading Configuration File
Posted: Tue Apr 11, 2017 10:45 am
by avandemore
If you're trying to solve the
Error: Could not read object configuration data!
issue, then that likely stems from selinux. You can temporarily disable it by running:
However it's a little difficult to tell what you want an answer on because you cite the error then ask questions about something else. The log files /var/log/syslog and the apache error log may also provide some insight into your issue.
Re: Reading Configuration File
Posted: Tue Apr 11, 2017 12:16 pm
by jcooper
Apache user "www-data" was already a member of the Nagios group
When attempting to run command "setenforce 0" it tells me it's not installed.
I'm just looking for possible solutions to why nagiosadmin can't read the config file (Nagios.cfg). I've done the Nagios config file check and it checks out fine.
Re: Reading Configuration File
Posted: Tue Apr 11, 2017 4:43 pm
by avandemore
You may need to refer to your OS's documentation on how to disable selinux.
Can you provide the log files I referenced?
Re: Reading Configuration File
Posted: Wed Apr 12, 2017 6:57 am
by jcooper
I've attached syslog and the apache error lines are below:
[Wed Apr 12 07:35:02.317235 2017] [mpm_prefork:notice] [pid 1391] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Wed Apr 12 07:35:02.317295 2017] [core:notice] [pid 1391] AH00094: Command line: '/usr/sbin/apache2'
Appreciate the help!
Re: Reading Configuration File
Posted: Wed Apr 12, 2017 12:29 pm
by tacolover101
how did you install? it's definitely permissions somewhere.
i would start fresh with the guides that the wizards at nagios wrote because they've worked every time for me.
https://support.nagios.com/kb/article.p ... ategory=58
Re: Reading Configuration File
Posted: Wed Apr 12, 2017 4:23 pm
by tgriep
Can you login to the Nagios server as root, run the following and post the output?
Code: Select all
ls -lR /usr/local/nagios/etc
grep nag /etc/passwd
grep nag /etc/group
cat /usr/local/nagios/etc/cgi.cfg