I got the following error while I was adding the router in Nagios. Please see the attachment. Can you please help me asap?
[root@localhost objects]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.4.6
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2020-04-28
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Could not open config directory '/usr/local/nagios/etc/servers' for reading.
Error: Invalid max_check_attempts value for host 'RAJU-LAPTOP'
Error: Could not register host (config file '/usr/local/nagios/etc/objects/windows.cfg', starting on line 21)
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data definitions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
please help
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: please help
Hi @fraju,
Thanks for joining the Nagios Community Forum! Looking out the output, it looks like the permissions may not be set correctly in the configurations.
Once you clear that error, run the pre-flight check again to make sure you do not have any configuration errors.
Thanks for joining the Nagios Community Forum! Looking out the output, it looks like the permissions may not be set correctly in the configurations.
Check the /usr/local/nagios/etc directory, it should look like the following:Error: Could not open config directory '/usr/local/nagios/etc/servers' for reading.
Code: Select all
[root@centos01 etc]# ls -lR
.:
total 144
-rw-rw-r--. 1 nagios nagios 13710 Sep 18 2019 cgi.cfg
-rw-rw-r--. 1 nagios nagios 13710 Sep 18 2019 cgi.cfg~
-rw-r--r--. 1 root root 50 Sep 18 2019 htpasswd.users
-rw-rw-r--. 1 nagios nagios 45843 Sep 18 2019 nagios.cfg
-rw-rw-r--. 1 nagios nagios 45843 Sep 18 2019 nagios.cfg~
drwxrwxr-x. 2 nagios nagios 4096 Dec 11 13:22 objects
-rw-rw----. 1 nagios nagios 1312 Sep 18 2019 resource.cfg
-rw-rw----. 1 nagios nagios 1312 Sep 18 2019 resource.cfg~
./objects:
total 104
-rw-rw-r--. 1 nagios nagios 6765 Sep 18 2019 commands.cfg
-rw-rw-r--. 1 nagios nagios 6765 Sep 18 2019 commands.cfg~
-rw-rw-r--. 1 nagios nagios 1797 Sep 18 2019 contacts.cfg
-rw-rw-r--. 1 nagios nagios 1797 Sep 18 2019 contacts.cfg~
-rw-rw-r--. 1 nagios nagios 4776 Oct 22 2019 localhost.cfg
-rw-rw-r--. 1 nagios nagios 4777 Sep 18 2019 localhost.cfg~
-rw-rw-r--. 1 nagios nagios 3001 Sep 18 2019 printer.cfg
-rw-rw-r--. 1 nagios nagios 3001 Sep 18 2019 printer.cfg~
-rw-rw-r--. 1 nagios nagios 3484 Sep 18 2019 switch.cfg
-rw-rw-r--. 1 nagios nagios 3484 Sep 18 2019 switch.cfg~
-rw-rw-r--. 1 nagios nagios 12533 Sep 18 2019 templates.cfg
-rw-rw-r--. 1 nagios nagios 12533 Sep 18 2019 templates.cfg~
-rw-rw-r--. 1 nagios nagios 3512 Sep 18 2019 timeperiods.cfg
-rw-rw-r--. 1 nagios nagios 3512 Sep 18 2019 timeperiods.cfg~
-rw-rw-r--. 1 nagios nagios 4074 Sep 18 2019 windows.cfg
-rw-rw-r--. 1 nagios nagios 4074 Sep 18 2019 windows.cfg~
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: please help
Hi Please find the attached screenshot and let me know how to fix the permission for those files? Thanks
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: please help
Hi @fraju,
Try running the following commands and let me know if you're still having trouble.
Try running the following commands and let me know if you're still having trouble.
Code: Select all
chown -R nagios:nagios /usr/local/nagios/etc/
chmod -R 775 /usr/local/nagios/etc/
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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: please help
I run your command but Still, I am getting the error...can you please check it ???
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: please help
Could you share your /usr/local/nagios/etc/objects.windows.cfg (redacting any necessary info)?
Also, it looks like your nagios.cfg has a cfg_dir specified for /usr/local/nagios/etc/servers but the path doesn't exist
Also, it looks like your nagios.cfg has a cfg_dir specified for /usr/local/nagios/etc/servers but the path doesn't exist
Re: please help
scottwilkerson wrote:Could you share your /usr/local/nagios/etc/objects.windows.cfg (redacting any necessary info)?
Also, it looks like your nagios.cfg has a cfg_dir specified for /usr/local/nagios/etc/servers but the path doesn't exist
Please find the attached files. please let me know if need anything, thanks
- Attachments
-
- nagios.cfg
- (44.86 KiB) Downloaded 184 times
-
- windows.cfg
- (4 KiB) Downloaded 195 times