Cannot open/overwrite the configuration file

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ytlcomm
Posts: 62
Joined: Tue May 22, 2012 8:52 pm

Cannot open/overwrite the configuration file

Post by ytlcomm »

Hi guys,

I'm having problem to write CCM configuration to physical file. Receive below error,
2-7-2013 5-08-55 PM.png
What I have done,
1. /usr/local/nagiosxi/scripts/reset_config_perms
2. NagiosXI-FixPerms.sh
3. Apply Configuration completed but no change.
4. Refer to NagiosQL Doc but apparently it is not properly updated. I'm afraid that it will get things worse than before.
http://www.nagiosql.org/documentation.html#Permissions
5. reconfigure_nagios.sh success but no changes as well.

Files/Folders Permission as below,

Code: Select all

# pwd
/usr/local/nagios
# ll
total 28
drwxrwxr-x.  2 nagios nagios 4096 Nov  1 14:52 bin
drwsr-sr-x.  8 apache nagios 4096 Feb  6 14:18 etc
drwxr-xr-x.  2 root   root   4096 Oct 31 16:02 include
drwxrwxr-x.  2 nagios nagios 4096 Feb  4 23:23 libexec
drwxrwxr-x.  2 nagios nagios 4096 Nov  1 14:53 sbin
drwxrwxr-x. 15 nagios nagios 4096 Nov  1 14:53 share
drwxrwxr-x.  9 nagios nagios 4096 Feb  7 17:13 var

Code: Select all

# pwd
/usr/local/nagios/etc
# ll
total 1024
drwxr-sr-x. 3 apache nagios   4096 Nov  1 11:18 cfgprep
-rwxr-xr-x  1 apache nagios   1344 Dec 28 09:56 cgi.cfg
-rwxr-xr-x  1 apache nagios  25327 Feb  7 16:18 commands.cfg
-rwxr-xr-x  1 apache nagios   1332 Feb  7 16:18 contactgroups.cfg
-rwxr-xr-x  1 apache nagios   6613 Feb  7 16:18 contacts.cfg
-rwxr-xr-x  1 apache nagios   1396 Feb  7 16:18 contacttemplates.cfg
-rwxr-xr-x  1 apache nagios    642 Feb  7 16:18 hostdependencies.cfg
-rwxr-xr-x  1 apache nagios    644 Feb  7 16:18 hostescalations.cfg
-rwxr-xr-x  1 apache nagios    662 Feb  7 16:18 hostextinfo.cfg
-rw-r--r--  1 apache nagios 265564 Feb  7 17:05 hostgroups.cfg
drwsr-sr-x. 2 apache nagios 544768 Feb  6 16:28 hosts
-rw-r--r--  1 apache nagios  14478 Feb  7 17:05 hosttemplates.cfg
drwsr-sr-x. 2 apache nagios   4096 Feb  6 16:08 import
-rwxr-xr-x  1 apache nagios   6576 Feb  6 14:30 nagios.cfg
-rwxr-xr-x  1 apache nagios   4096 Oct 31 17:21 nagios.cfg.18052012
-rwxr-xr-x  1 apache nagios   6375 Jan 18 14:10 nagios.cfg.save
-rwxr-xr-x  1 apache nagios   5764 Oct 31 14:45 nagios.cfg.xi
-rwxr-xr-x  1 apache nagios   2458 Jan 14 16:02 ndo2db.cfg
-rwxr-xr-x  1 apache nagios   2229 Oct 31 17:21 ndo2db.cfg.bak
-rwxr-xr-x  1 apache nagios   4723 Oct 31 17:21 ndomod.cfg
-rwxr-xr-x  1 apache nagios   4096 Oct 31 17:21 nrpe.cfg
-rwxr-xr-x  1 apache nagios   5345 Oct 31 17:21 nsca.cfg
-rwxr-xr-x  1 apache nagios   5345 Oct 31 14:47 nsca.cfg.orig
drwsr-sr-x. 4 apache nagios   4096 Feb  5 12:41 pnp
-rwxr-xr-x  1 apache nagios      0 Oct 31 17:21 recurringdowntime.cfg
-rwxr-xr-x  1 apache nagios    210 Oct 31 17:21 resource.cfg
-rwxr-xr-x  1 apache nagios    210 Oct 31 14:45 resource.cfg.xi
-rwxr-xr-x  1 apache nagios   1627 Oct 31 17:21 send_nsca.cfg
-rwxr-xr-x  1 apache nagios   1627 Oct 31 14:47 send_nsca.cfg.orig
-rwxr-xr-x  1 apache nagios    648 Feb  7 16:18 servicedependencies.cfg
-rwxr-xr-x  1 apache nagios    650 Feb  7 16:18 serviceescalations.cfg
-rwxr-xr-x  1 apache nagios    668 Feb  7 16:18 serviceextinfo.cfg
-rw-r--r--  1 apache nagios    770 Feb  7 17:05 servicegroups.cfg
drwsr-sr-x. 2 apache nagios   4096 Jan 17 15:41 services
-rw-r--r--  1 apache nagios  21182 Feb  7 17:05 servicetemplates.cfg
drwsr-sr-x. 2 apache nagios   4096 Dec 26 16:01 static
-rwxr-xr-x  1 apache nagios  14961 Feb  7 16:18 timeperiods.cfg
Group File Output

Code: Select all

# cat /etc/group | grep nag
apache:x:48:nagios
nagios:x:500:nagios,apache
nagcmd:x:501:nagios,apache
As you can see from hosts and services folders, it didn't get updated for some time. Please help.

Nagios XI 2012R1.3
NagiosQL Version 3.0.3

- Faiz
You do not have the required permissions to view the files attached to this post.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Cannot open/overwrite the configuration file

Post by slansing »

Just to confirm it is not already a known issue, can you run the following again, and make sure to restart Apache and Nagios?:

Code: Select all

chmod -R 775 /usr/local/nagios/etc

Code: Select all

service apache restart

service nagios restart
ytlcomm
Posts: 62
Joined: Tue May 22, 2012 8:52 pm

Re: Cannot open/overwrite the configuration file

Post by ytlcomm »

I have done the following,
2-8-2013 9-32-25 AM.png
The result still the same,
2-8-2013 9-43-30 AM.png
I think this problem occur after I use 'Apply Configuration' rather than this 'Write, Check and Restart' tool.
You do not have the required permissions to view the files attached to this post.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Cannot open/overwrite the configuration file

Post by mguthrie »

The permissions are failing on files in the following two directories:

/usr/local/nagios/etc/hosts
/usr/local/nagios/etc/services

Make sure those directories, and all files in them are owned apache:nagios.
ytlcomm
Posts: 62
Joined: Tue May 22, 2012 8:52 pm

Re: Cannot open/overwrite the configuration file

Post by ytlcomm »

Hi,

hosts and services permission already set as below,

Code: Select all

drwsrwsr-x. 2 apache nagios 544768 Feb  6 16:28 hosts
drwsrwsr-x. 2 apache nagios   4096 Jan 17 15:41 services
In hosts folder,

Code: Select all

...
-rwxrwxr-x 1 apache nagios 1091 Feb  6 17:51 YTL_Residence_9835P01.cfg
In services folder,

Code: Select all

...
-rwxrwxr-x 1 apache nagios   4383 Feb  7 11:08 VLEVM.cfg
What is wrong here? Problem not solve. Please help.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Cannot open/overwrite the configuration file

Post by mguthrie »

Can you access the Admin->Check File Permissions page and post a screenshot from it?

Also, can you post the output from :

Code: Select all

sestatus
ytlcomm
Posts: 62
Joined: Tue May 22, 2012 8:52 pm

Re: Cannot open/overwrite the configuration file

Post by ytlcomm »

Config Scripts
The permissions on the Nagios XI configuration scripts appear to be okay.

Config Files
The permissions on the Nagios Core configuration files to be okay.

# sestatus
SELinux status: disabled
ytlcomm
Posts: 62
Joined: Tue May 22, 2012 8:52 pm

Re: Cannot open/overwrite the configuration file

Post by ytlcomm »

Possible to remote my system?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Cannot open/overwrite the configuration file

Post by lmiltchev »

Email us at xisupport@nagios.com. This will open a new support ticket in our system and we will take it from there. Put "Cannot open/overwrite the configuration file" in the subject, and post a link to this post in the body of the email. Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!
ytlcomm
Posts: 62
Joined: Tue May 22, 2012 8:52 pm

Re: Cannot open/overwrite the configuration file

Post by ytlcomm »

Done. Please check.
Locked