Reading Configuration File

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.
jcooper
Posts: 7
Joined: Tue Aug 02, 2016 12:58 pm

Reading Configuration File

Post 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!
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Reading Configuration File

Post by avandemore »

You can see file permissions by doing a:

Code: Select all

ls -la <file>
Nagios Core configuration usually starts with a file named nagios.cfg which references other configuration files.
Previous Nagios employee
jcooper
Posts: 7
Joined: Tue Aug 02, 2016 12:58 pm

Re: Reading Configuration File

Post 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!
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: Reading Configuration File

Post by tacolover101 »

is your apache user in the nagios group?
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Reading Configuration File

Post 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:

Code: Select all

setenforce 0
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.
Previous Nagios employee
jcooper
Posts: 7
Joined: Tue Aug 02, 2016 12:58 pm

Re: Reading Configuration File

Post 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.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Reading Configuration File

Post 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?
Previous Nagios employee
jcooper
Posts: 7
Joined: Tue Aug 02, 2016 12:58 pm

Re: Reading Configuration File

Post 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!
Attachments
syslog.txt
(200.59 KiB) Downloaded 232 times
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: Reading Configuration File

Post 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
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Reading Configuration File

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked