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.
Tettehp
Posts: 6
Joined: Wed Oct 02, 2019 10:43 am

Error: Could not read object configuration data!

Post by Tettehp »

Hi, I have a problem that I have no idea how to progress. I am new to Nagios so I was hoping that you guys might be able to help me out. I am working with Nagios Core 4.4.3 (the free version). When I put 7000 records in the hosts.cfg file, it works fine and it displays the servers on the web interface. We have a total of about 16,000 servers we will be monitoring. When I load all 16,000, and run the Nagios Config Checker (/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg) it says 'Things look okay'. I then restart the Nagios service and everything is fine, but when I go to the Nagios web portal it gives me the Error.....

(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 https://www.nagios.org.) 

I dialed the records back to 7600 and it worked fine. When I increased the records to 7700, I got the error page. I dialed it back to 7600 and still got the error page. When I dialed it back to 7500, it worked fine.

I had initially thought that there might have been a hard limit set somewhere in the Nagios configuration files but since the limit seemed to fluctuate between 7500 and 7600 records for our Nagios install, could it be a resources issue? I am completely stumped and I would appreciate any help in figuring this out.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Error: Could not read object configuration data!

Post by benjaminsmith »

Hello,

There isn't a hard limit and the Nagios Core web interface is very efficient as it's compiled cgi scripts. This does seem like a resource error. What is the status of Nagios when you get his error, is it still running?

Code: Select all

systemctl status nagios.service
Can you post the nagios and system logs so we can review any error messages. Also, any error messages in the Apache logs?

Code: Select all

tail -n 20 /usr/local/nagios/var/nagios.log
tail -n 20 /var/log/messages
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Tettehp
Posts: 6
Joined: Wed Oct 02, 2019 10:43 am

Re: Error: Could not read object configuration data!

Post by Tettehp »

Thanks for the reply Benjaminsmith. Nagios is running when I get the error. I have attached a number of logs to see if this will help. I am stumped. 7500 servers in the host file and it works fine. 7700 and it shows the error I posted before, yet the config checker says everything is fine!
Attachments
messages.txt
(2.09 KiB) Downloaded 157 times
systemctl Nagios status.txt
(204.64 KiB) Downloaded 167 times
Nagios log.txt
(2.59 KiB) Downloaded 160 times
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Error: Could not read object configuration data!

Post by cdienger »

Are you able to break up the configuration into smaller files? Most of the time people use 1 file per host. You can definitely do more, but 7000+ seems like a lot.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Tettehp
Posts: 6
Joined: Wed Oct 02, 2019 10:43 am

Re: Error: Could not read object configuration data!

Post by Tettehp »

Hi cdienger. I'm new to Nagios so I'm not sure what you mean. I have all the server data in one host.cfg file. Are you saying that I can have more than one host.cfg file?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Error: Could not read object configuration data!

Post by cdienger »

Correct. Check your nagios.cfg file for the cfg_dir directive. This option tells nagios to load all configuration files inside of whatever directory it is pointing to.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Tettehp
Posts: 6
Joined: Wed Oct 02, 2019 10:43 am

Re: Error: Could not read object configuration data!

Post by Tettehp »

Thanks cdienger. Do I call the file hosts.cfg also, or do I give it a different name. (Is there anything special I need to do? is this in the documentation? I don't want to go by the trial and error method :) )
Tettehp
Posts: 6
Joined: Wed Oct 02, 2019 10:43 am

Re: Error: Could not read object configuration data!

Post by Tettehp »

So, I created the hosts folder (/usr/local/Nagios/etc/hosts/ and I move the hosts.cfg file into it. I also created a hosts2.cfg file in the hosts folder and loaded it with the remaining 5200 records. (hosts.cfg has 7500 records). I modified the Nagios.cfg file with cfg_dir=/usr/local/nagios/etc/hosts and I commented out cfg_file=/usr/local/nagios/etc/objects/hosts.cfg. When Iran the Nagios config checker (/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg) it said everything was fine. I then restarted the Nagios service (systemctl restart Nagios.service) and it restarted fine but when I refreshed the web portal it gave me ……

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 https://www.nagios.org.)

but the Nagios service is running fine.

I am at a loss as to how to proceed now. It seems that Nagios core has a limit of about 7500 server records in its host file. (this is what I mean by record.....

define host {
host_name 0ccb-cp36
alias 0ccb-cp36
address 0ccb-cp36
hostgroups pings, No_Ping_From_Server
check_command check_ping
check_command check-host-alive
max_check_attempts 5
check_period 24x7
contact_groups admins
notification_interval 30
notification_period 24x7
}

)

I am at a loss as to how to proceed now. It keeps looking more and more like Nagios has a limit of 7500/7600 records. When the record total is dialed nack to 7500, the web interface works the was it should. Increase the records to 8000 (even 7700) and it doesn't.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Error: Could not read object configuration data!

Post by ssax »

I'm wondering if this is an apache limit somewhere or a ulimit?

Are you using NDO2DB as well?

What is the output of these commands (as root)?

Code: Select all

ulimit -a
su - nagios
ulimit -a
grep apache /etc/group
grep nag /etc/group
ls -l /usr/local/nagios/var
ls -l /usr/local/nagios/var/rw
Please run this command and PM me the resulting /tmp/FILES.zip file:

Code: Select all

zip -R /tmp/FILES.zip /etc/httpd/conf.d /etc/httpd/conf/httpd.conf /usr/local/nagios/etc
Tettehp
Posts: 6
Joined: Wed Oct 02, 2019 10:43 am

Re: Error: Could not read object configuration data!

Post by Tettehp »

Hi Ssax. No, we are not using NDO2DB. I have uploaded a text file with the results of all your commands. The zip file did not execute. (we don't have an httpd subdirectory in the etc directory.). Thanks!
Attachments
Nagios command results.txt
(2.19 KiB) Downloaded 171 times
Locked