please help

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.
Locked
fraju
Posts: 4
Joined: Thu May 28, 2020 4:46 am

please help

Post by fraju »

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.
Attachments
Capture.JPG
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: please help

Post by benjaminsmith »

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.
Error: Could not open config directory '/usr/local/nagios/etc/servers' for reading.
Check the /usr/local/nagios/etc directory, it should look like the following:

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~
Once you clear that error, run the pre-flight check again to make sure you do not have any configuration errors.

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!
fraju
Posts: 4
Joined: Thu May 28, 2020 4:46 am

Re: please help

Post by fraju »

Hi Please find the attached screenshot and let me know how to fix the permission for those files? Thanks
Attachments
Capture.JPG
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: please help

Post by benjaminsmith »

Hi @fraju,

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!
fraju
Posts: 4
Joined: Thu May 28, 2020 4:46 am

Re: please help

Post by fraju »

I run your command but Still, I am getting the error...can you please check it ???
Attachments
Capture.JPG
Capture.JPG
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: please help

Post by scottwilkerson »

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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
fraju
Posts: 4
Joined: Thu May 28, 2020 4:46 am

Re: please help

Post by fraju »

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 170 times
windows.cfg
(4 KiB) Downloaded 183 times
Locked