Nagios - Error: Could not read object configuration data

Riaan Schutte picture Riaan Schutte · Jan 7, 2014 · Viewed 25.9k times · Source

We have a working version of Nagios 3.2.0 running on two other servers but on these new server we installed it using apt-get install but keep getting the following problem. The permissions and config file is all default from install and everything seems correct when comparing it to the working versions we have of Nagios...

Note: The Nagios website is running but when i click on any option on the left i get this...

Error: Could not read object configuration data!  
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.

Running

sudo /usr/sbin/nagios3 -v /etc/nagios3/nagios.cfg

Gives:

...
Total Warnings: 0
Total Errors:   0

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

/var/log/nagios3/nagios.log gives no errors, just a bunch of:

...
[1389054450] Auto-save of retention data completed successfully.
[1389058050] Auto-save of retention data completed successfully.

Not a permission issue either tried changing everything to nagios user and group but no luck:

drwxr-xr-x   4 root root    4096 2013-12-10 16:35 .
drwxr-xr-x 141 root root   12288 2014-01-06 16:27 ..
-rw-r--r--   1 root root    1905 2011-06-08 01:07 apache2.conf
-rw-r--r--   1 root root   12218 2011-06-08 01:08 cgi.cfg
-rw-r--r--   1 root root    2441 2011-06-08 01:08 commands.cfg
drwxr-xr-x   2 root root    4096 2013-12-10 16:35 conf.d
-rw-r--r--   1 root root      26 2013-12-10 16:35 htpasswd.users
-rw-r--r--   1 root root   43769 2011-06-08 01:08 nagios.cfg
-rw-r-----   1 root nagios  1293 2011-06-08 01:07 resource.cfg
drwxr-xr-x   2 root root    4096 2013-12-10 16:35 stylesheets

Changed it back to root.

Stopped Nagios and restarted but still nothing. Please help!

Answer

Tharanga Abeyseela picture Tharanga Abeyseela · Jan 7, 2014

This is a permission issue, webserver user should be able to accees nagios directory structure. try the following . assuming your web server is not running as the root user.

chgrp -R webserver_user /var/cache/nagiosx/  

and also check other nagios directories for correct permissions.