Redhat 6
----
The following configuration files have incorrect permissions:
* /usr/local/nagios/etc/commands.cfg (OWNER=root, GROUP=root, PERMS=u---------)
* /usr/local/nagios/etc/contactgroups.cfg (OWNER=root, GROUP=root, PERMS=u---------)
* /usr/local/nagios/etc/contacts.cfg (OWNER=root, GROUP=root, PERMS=u---------)
* /usr/local/nagios/etc/contacttemplates.cfg (OWNER=root, GROUP=root, PERMS=u---------)
* /usr/local/nagios/etc/hostdependencies.cfg (OWNER=root, GROUP=root, PERMS=u---------)
* /usr/local/nagios/etc/hostescalations.cfg (OWNER=root, GROUP=root, PERMS=u---------)
* /usr/local/nagios/etc/hostextinfo.cfg (OWNER=root, GROUP=root, PERMS=u---------)
* /usr/local/nagios/etc/hostgroups.cfg (OWNER=root, GROUP=root, PERMS=u---------)
* /usr/local/nagios/etc/hosttemplates.cfg (OWNER=root, GROUP=root, PERMS=u---------)
* /usr/local/nagios/etc/servicedependencies.cfg (OWNER=root, GROUP=root, PERMS=u---------)
* /usr/local/nagios/etc/serviceescalations.cfg (OWNER=root, GROUP=root, PERMS=u---------)
* /usr/local/nagios/etc/serviceextinfo.cfg (OWNER=root, GROUP=root, PERMS=u---------)
* /usr/local/nagios/etc/servicegroups.cfg (OWNER=root, GROUP=root, PERMS=u---------)
* /usr/local/nagios/etc/servicetemplates.cfg (OWNER=root, GROUP=root, PERMS=u---------)
* /usr/local/nagios/etc/timeperiods.cfg (OWNER=root, GROUP=root, PERMS=u---------)
Each of these config files needs to be writable by the apache and nagios users. To fix this problem, follow these steps:
* Login to your Nagios XI server via SSH as the root user
* Execute the following commands:
o /usr/local/nagiosxi/scripts/reset_config_perms
-------------------------
On another post I saw this - but it didn't make a difference
chmod 664 /usr/local/nagios/etc/*.cfg
chown apache:nagios /usr/local/nagios/etc/*.cfg
-rw-rw-r-- 1 apache nagios 984 Jul 19 11:44 cgi.cfg
drwxrwxr-x 2 apache nagios 4096 Jul 18 09:55 hosts
drwxrwxr-x 2 apache nagios 4096 Jul 19 11:44 import
-rw-rw-r-- 1 apache nagios 5657 Jul 18 09:55 nagios.cfg
-rw-rw-r-- 1 apache nagios 2229 Jul 18 09:56 ndo2db.cfg
-rw-rw-r-- 1 apache nagios 4827 Jul 18 09:56 ndomod.cfg
-rw-rw-r-- 1 apache nagios 12455 Jul 18 09:56 nrpe.cfg
-rw-rw-r-- 1 apache nagios 5345 Jul 18 09:56 nsca.cfg
drwxrwxr-x 4 apache nagios 4096 Jul 18 09:56 pnp
-rw-rw-r-- 1 apache nagios 210 Jul 18 09:55 resource.cfg
-rw-rw-r-- 1 apache nagios 1627 Jul 18 09:56 send_nsca.cfg
drwxrwxr-x 2 apache nagios 4096 Jul 18 09:55 services
drwxrwxr-x 2 apache nagios 4096 Jul 18 09:55 static
-------------------
I tried to restart but get this when try to restart nagios service
Starting nagios:
Nagios Core 4.4.3
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2019-01-15
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Cannot open config file '/usr/local/nagios/etc/contacttemplates.cfg' for reading: No such file or directory
Error processing object config files!
files have incorrect permissions - but they are correct
-
seaward1983
- Posts: 69
- Joined: Wed Jul 17, 2019 2:09 pm
Re: files have incorrect permissions - but they are correct
What is the version of Nagios XI that you are currently using? Is this a fresh install or an upgrade? If it is an upgrade, what is the version of XI that you upgraded from? Is this a OVA, manual install/upgrade, RPM install/upgrade, online or offline?
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
seaward1983
- Posts: 69
- Joined: Wed Jul 17, 2019 2:09 pm
Re: files have incorrect permissions - but they are correct
This is a fresh install of XI. Offline install.
Your Nagios XI installation is up to date.
Latest Available Version: 5.6.4
Installed Version: 5.6.4
Last Update Check: 2019-07-18 10:34:42
Your Nagios XI installation is up to date.
Latest Available Version: 5.6.4
Installed Version: 5.6.4
Last Update Check: 2019-07-18 10:34:42
Re: files have incorrect permissions - but they are correct
I performed an offline install of Nagios XI 5.6.4, and didn't have any permissions issues whatsoever... Have you tried modifying the default permissions on the system, e.g. hardening the server?
Go to the CCM > Tools > Config File Management, click on Write Configs then on Verify Files, and show the output after each click.
Also, PM me your latest profile (Admin > System Config > System Profile > Download Profile).
Go to the CCM > Tools > Config File Management, click on Write Configs then on Verify Files, and show the output after each click.
Also, PM me your latest profile (Admin > System Config > System Profile > Download Profile).
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
seaward1983
- Posts: 69
- Joined: Wed Jul 17, 2019 2:09 pm
Re: files have incorrect permissions - but they are correct
Well - that took care of THAT error - when I told it to restart Nagios core - I got this
Error: There are no services defined!
Error: There are no hosts defined!
Error: There are no contacts defined!
Error: Global host event handler command 'xi_host_event_handler' is not defined anywhere!
Error: Global service event handler command 'xi_service_event_handler' is not defined anywhere!
PMing you the profile now
Error: There are no services defined!
Error: There are no hosts defined!
Error: There are no contacts defined!
Error: Global host event handler command 'xi_host_event_handler' is not defined anywhere!
Error: Global service event handler command 'xi_service_event_handler' is not defined anywhere!
PMing you the profile now
Re: files have incorrect permissions - but they are correct
The profile that you sent me didn't have ANY configs in it... Looking at the errors below:
You could try the following in order to fix the issue:
1. Download Nagios XI 5.6.4 tarball from here:
https://assets.nagios.com/downloads/nag ... 6.4.tar.gz
2. Copy it over to the /tmp directory on the offline server, and untar it:
3. Copy some (or all of the configs in the following directories), depending on what you are missing to the import directory:
4. Run reconfigure_nagios.sh script to import the configs:
Note: Another option would be to start from scratch and do a new, fresh install of Nagios XI.
I am beginning to think that you are missing all of these objects, and were never able to apply configuration even once. Did you delete localhost, contacts, and possibly other configs right after you installed Nagios XI?!Error: There are no services defined!
Error: There are no hosts defined!
Error: There are no contacts defined!
Error: Global host event handler command 'xi_host_event_handler' is not defined anywhere!
Error: Global service event handler command 'xi_service_event_handler' is not defined anywhere!
You could try the following in order to fix the issue:
1. Download Nagios XI 5.6.4 tarball from here:
https://assets.nagios.com/downloads/nag ... 6.4.tar.gz
2. Copy it over to the /tmp directory on the offline server, and untar it:
Code: Select all
cd /tmp
tar xvf xi-5.6.4.tar.gzCode: Select all
cd /tmp/nagiosxi/subcomponents/nagioscore/mods/cfg/objects
cp ./* /usr/local/nagios/etc/import
cd /tmp/nagiosxi/subcomponents/nagioscore/mods/cfg/import
cp ./* /usr/local/nagios/etc/importCode: Select all
/usr/local/nagiosxi/scripts/reconfigure_nagios.shBe sure to check out our Knowledgebase for helpful articles and solutions!
-
seaward1983
- Posts: 69
- Joined: Wed Jul 17, 2019 2:09 pm
Re: files have incorrect permissions - but they are correct
That took care of that! Thanks.
Re: files have incorrect permissions - but they are correct
Glad to hear everything is working!
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!