Web interface Error:Could not read object configuration data

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.
zander_2
Posts: 17
Joined: Mon Jul 29, 2013 3:55 pm

Web interface Error:Could not read object configuration data

Post by zander_2 »

I've been trying to get a Nagios server set up on my virtual machine, and I've done it once before, but this time I'm encountering errors. A little bit of background first:
My first install worked just fine for a long time, then when I tried to run some checks on another machine via check_by_ssh, it gave me a series of errors that I fixed in some weird roundabout ways, but I ended up with a "Return code of 127 is out of bounds - plugin may be missing" error, just for that single process on the services page. I knew I had installed the plugins correctly and after messing around with it for a long time, I came to the conclusion that I must have messed something up while fixing the older errors or doing some initial config a few weeks earlier.

Today, I started up two new VMs and installed a clean version of Nagios (all of these are 3.5.0, by the way) on one to see if the problem still happened, but I never got that far. I logged into the web interface, which worked fine, but when I clicked on any of the links in the sidebar (hosts, services, map, etc) it just said:
Forbidden

You don't have permission to access /nagios/cgi-bin//tac.cgi on this server.
After trying to work through the for a while, I decided to just try to see if it worked on the second of the new VMs. Another clean Nagios install, and I got to the same point, and this time when I clicked on the sidebar links it said:
Whoops!

Error: Could not read object configuration data!

Here are some things you should check in order to resolve this error:

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.
Make sure you read the documentation on installing, configuring and running Nagios thoroughly before continuing. If all else fails, try sending a message to one of the mailing lists. More information can be found at http://www.nagios.org.
Verifying configuration options (on either of the VMs) comes up 100% clean with no warnings or errors. So I decided to check the log files. Interestingly, both VMs came up with repeated messages saying:
Warning: Return code of 127 for check of service 'PING' on host 'localhost' was out of bounds. Make sure the plugin you're trying to run actually exists.
What's strange is that it seems I got the same error 3 times, putting out 3 different types of text, and at different points in the setup process. Keep in mind, on the two newer VMs I hadn't even configured any hosts or services or anything; I was just trying to see if the web interface worked. Most of the people who have had this issue here or anywhere else on the internet have had it in the way I had it the first time around: related to a single service, which put up a "critical" error and turned its box red. I have yet to see anyone encountering this issue without even having any services running, so any help would be appreciated.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Web interface Error:Could not read object configuration

Post by lmiltchev »

Did you encounter any errors, while installing nagios plugins? What is the output of the following command?

Code: Select all

ls -la /usr/local/nagios/libexec
Be sure to check out our Knowledgebase for helpful articles and solutions!
zander_2
Posts: 17
Joined: Mon Jul 29, 2013 3:55 pm

Re: Web interface Error:Could not read object configuration

Post by zander_2 »

lmiltchev wrote:Did you encounter any errors, while installing nagios plugins? What is the output of the following command?

Code: Select all

ls -la /usr/local/nagios/libexec
Sorry for not responding, I moved on to other things. I didn't have any issues installing, and the output of the command is:

Code: Select all

drwxrwxr-x 2 nagios nagios   4096 Jul 31 09:15 .
drwxr-xr-x 8 root   root     4096 Jul 30 10:02 ..
-rwxr-xr-x 1 nagios nagios 351321 Jul 30 10:10 check_apt
-rwxr-xr-x 1 nagios nagios   2265 Jul 30 10:10 check_breeze
-rwxr-xr-x 1 root   root    53328 Aug 17  2012 check_by_ssh
lrwxrwxrwx 1 root   root        9 Jul 30 10:10 check_clamd -> check_tcp
-rwxr-xr-x 1 nagios nagios  50785 Jul 30 10:10 check_cluster
-r-sr-xr-x 1 root   nagios  89965 Jul 30 10:10 check_dhcp
-rwxr-xr-x 1 nagios nagios 393562 Jul 30 10:10 check_disk
-rwxr-xr-x 1 nagios nagios   8163 Jul 30 10:10 check_disk_smb
-rwxr-xr-x 1 nagios nagios  46188 Jul 30 10:10 check_dummy
-rwxr-xr-x 1 nagios nagios   3143 Jul 30 10:10 check_file_age
-rwxr-xr-x 1   1000 users   15268 Nov 10  2009 check_file_count
-rwxr-xr-x 1 nagios nagios   6395 Jul 30 10:10 check_flexlm
lrwxrwxrwx 1 root   root        9 Jul 30 10:10 check_ftp -> check_tcp
-rwxr-xr-x 1 nagios nagios 464227 Jul 30 10:10 check_http
-r-sr-xr-x 1 root   nagios  95661 Jul 30 10:10 check_icmp
-rwxr-xr-x 1 nagios nagios  59156 Jul 30 10:10 check_ide_smart
-rwxr-xr-x 1 nagios nagios  15310 Jul 30 10:10 check_ifoperstatus
-rwxr-xr-x 1 nagios nagios  12853 Jul 30 10:10 check_ifstatus
lrwxrwxrwx 1 root   root        9 Jul 30 10:10 check_imap -> check_tcp
-rwxr-xr-x 1 nagios nagios   7429 Jul 30 10:10 check_ircd
lrwxrwxrwx 1 root   root        9 Jul 30 10:10 check_jabber -> check_tcp
-rwxr-xr-x 1 nagios nagios  73450 Jul 30 10:10 check_load
-rwxr-xr-x 1 nagios nagios   6062 Jul 30 10:10 check_log
-rwxr-xr-x 1 nagios nagios  20367 Jul 30 10:10 check_mailq
-rwxr-xr-x 1 nagios nagios  58434 Jul 30 10:10 check_mrtg
-rwxr-xr-x 1 nagios nagios  58707 Jul 30 10:10 check_mrtgtraf
-rwxr-xr-x 1 nagios nagios  72423 Jul 30 10:10 check_nagios
lrwxrwxrwx 1 root   root        9 Jul 30 10:10 check_nntp -> check_tcp
lrwxrwxrwx 1 root   root        9 Jul 30 10:10 check_nntps -> check_tcp
-rwxrwxr-x 1 nagios nagios  75436 Jul 30 11:46 check_nrpe
-rwxr-xr-x 1 nagios nagios  89075 Jul 30 10:10 check_nt
-rwxr-xr-x 1 nagios nagios  95971 Jul 30 10:10 check_ntp
-rwxr-xr-x 1 nagios nagios  83795 Jul 30 10:10 check_ntp_peer
-rwxr-xr-x 1 nagios nagios  83012 Jul 30 10:10 check_ntp_time
-rwxr-xr-x 1 nagios nagios 125026 Jul 30 10:10 check_nwstat
-rwxr-xr-x 1 nagios nagios   8366 Jul 30 10:10 check_oracle
-rwxr-xr-x 1 nagios nagios  75343 Jul 30 10:10 check_overcr
-rwxr-xr-x 1 nagios nagios  97310 Jul 30 10:10 check_ping
lrwxrwxrwx 1 root   root        9 Jul 30 10:10 check_pop -> check_tcp
-rwxr-xr-x 1 nagios nagios  95136 Jul 30 10:10 check_procs
-rwxr-xr-x 1 nagios nagios  70458 Jul 30 10:10 check_real
-rwxr-xr-x 1 nagios nagios   9707 Jul 30 10:10 check_rpc
-rwxr-xr-x 1 nagios nagios   1176 Jul 30 10:10 check_sensors
lrwxrwxrwx 1 root   root        9 Jul 30 10:10 check_simap -> check_tcp
-rwxr-xr-x 1 nagios nagios 405932 Jul 30 10:10 check_smtp
lrwxrwxrwx 1 root   root        9 Jul 30 10:10 check_spop -> check_tcp
-rwxr-xr-x 1 nagios nagios  68706 Jul 30 10:10 check_ssh
lrwxrwxrwx 1 root   root        9 Jul 30 10:10 check_ssmtp -> check_tcp
-rwxr-xr-x 1 nagios nagios  74732 Jul 30 10:10 check_swap
-rwxr-xr-x 1 nagios nagios 122836 Jul 30 10:10 check_tcp
-rwxr-xr-x 1 nagios nagios  70564 Jul 30 10:10 check_time
lrwxrwxrwx 1 root   root        9 Jul 30 10:10 check_udp -> check_tcp
-rwxr-xr-x 1 nagios nagios  82074 Jul 30 10:10 check_ups
-rwxr-xr-x 1 nagios nagios  68715 Jul 30 10:10 check_users
-rwxr-xr-x 1 nagios nagios   3019 Jul 30 10:10 check_wave
-rwxr-xr-x 1 nagios nagios  73816 Jul 30 10:10 negate
-rwxr-xr-x 1 nagios nagios  68170 Jul 30 10:10 urlize
-rwxr-xr-x 1 nagios nagios   2035 Jul 30 10:10 utils.pm
-rwxr-xr-x 1 nagios nagios    862 Jul 30 10:10 utils.sh
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Web interface Error:Could not read object configuration

Post by lmiltchev »

Run the following commands and show us the output:

Code: Select all

service nagios status
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Also, restart apache and tail the apache error log:

Code: Select all

service httpd restart
tail /var/log/httpd/error_log
Be sure to check out our Knowledgebase for helpful articles and solutions!
zander_2
Posts: 17
Joined: Mon Jul 29, 2013 3:55 pm

Re: Web interface Error:Could not read object configuration

Post by zander_2 »

lmiltchev wrote:Run the following commands and show us the output:

Code: Select all

service nagios status
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Also, restart apache and tail the apache error log:

Code: Select all

service httpd restart
tail /var/log/httpd/error_log
The first command gives:

Code: Select all

nagios (pid 1178) is running...
Second gives:

Code: Select all

Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/localhost.cfg'...
Processing object config directory '/usr/local/nagios/etc/servers'...
Processing object config file '/usr/local/nagios/etc/servers/clients.cfg'...
Processing object config directory '/usr/local/nagios/etc/conf.d'...
Processing object config file '/usr/local/nagios/etc/conf.d/services.cfg'...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
        Checked 10 services.
Checking hosts...
Warning: Host 'nagiostest03' has no services associated with it!
        Checked 3 hosts.
Checking host groups...
        Checked 1 host groups.
Checking service groups...
        Checked 0 service groups.
Checking contacts...
        Checked 1 contacts.
Checking contact groups...
        Checked 1 contact groups.
Checking service escalations...
        Checked 0 service escalations.
Checking service dependencies...
        Checked 0 service dependencies.
Checking host escalations...
        Checked 0 host escalations.
Checking host dependencies...
        Checked 0 host dependencies.
Checking commands...
        Checked 25 commands.
Checking time periods...
        Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 1
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
The warning doesn't seem to be a problem; the services are all supposed to be running on the other host anyway.

Third command gives:

Code: Select all

Stopping httpd:                                            [  OK  ]
Starting httpd: httpd: apr_sockaddr_info_get() failed for nagiostest03
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                                           [  OK  ]
I've been getting that since I installed apache, and again, it doesn't seem to be causing any problems. My first VM, however, didn't have that error.

And finally, fourth command gives:

Code: Select all

[Mon Aug 05 10:16:07 2013] [notice] Digest: generating secret for digest authentication ...
[Mon Aug 05 10:16:07 2013] [notice] Digest: done
[Mon Aug 05 10:16:07 2013] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 configured -- resuming normal operations
[Tue Aug 06 14:25:09 2013] [notice] caught SIGTERM, shutting down
[Tue Aug 06 14:25:10 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Aug 06 14:25:15 2013] [notice] Digest: generating secret for digest authentication ...
[Tue Aug 06 14:25:15 2013] [notice] Digest: done
[Tue Aug 06 14:25:15 2013] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 configured -- resuming normal operations
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Web interface Error:Could not read object configuration

Post by abrist »

What linux distribution/version is running on teh nagios core server?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Web interface Error:Could not read object configuration

Post by lmiltchev »

Is SELinux enabled?

Code: Select all

sestatus
What is the output of the following command?

Code: Select all

grep nag /etc/group
Be sure to check out our Knowledgebase for helpful articles and solutions!
zander_2
Posts: 17
Joined: Mon Jul 29, 2013 3:55 pm

Re: Web interface Error:Could not read object configuration

Post by zander_2 »

abrist wrote:What linux distribution/version is running on teh nagios core server?
CentOS 6.0.
lmiltchev wrote:Is SELinux enabled?

Code: Select all

sestatus
No it is not, as per my boss's orders. I know that's not the safest thing in the world, but it's a private test network and it was harder to keep adding exceptions than to just turn it off.
lmiltchev wrote:What is the output of the following command?

Code: Select all

grep nag /etc/group

Code: Select all

nagios:x:500:
nagcmd:x:501:nagios,apache
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Web interface Error:Could not read object configuration

Post by lmiltchev »

Modify the "/etc/group", so that you would have:
nagios:x:500:nagios,apache
nagcmd:x:501:nagios,apache
Let us know if this fixes your issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Web interface Error:Could not read object configuration

Post by abrist »

Well, the users nagios and apache must be members of the nagios group:

Code: Select all

useradd -G nagios nagios
useradd -G nagios apache
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked