/usr/local/nagios/etc conf files permission

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ilohp
Posts: 1
Joined: Fri Feb 05, 2010 4:16 pm

/usr/local/nagios/etc conf files permission

Post by ilohp »

I have a problem with the configuration files on Nagios XI. I set /usr/local/nagios/* to nagios:nagios 755 and everything looks ok. After make any change on the configuration and apply the configuration changes, some of the /etc/.cfg files are going back to nagios:user and the write conf files tool is failing with writing permission. Help!
Ileana
-rwxrwxr-x 1 nagios users 744 Jan 11 10:14 cgi.cfg
-rwxrwxr-x 1 nagios users 14771 Feb 16 15:35 commands.cfg
-rwxrwxr-x 1 nagios users 1113 Feb 16 15:35 contactgroups.cfg
-rwxrwxr-x 1 nagios users 1612 Feb 16 15:35 contacts.cfg
-rwxrwxr-x 1 nagios users 1437 Feb 16 15:35 contacttemplates.cfg
-rwxrwxr-x 1 nagios users 662 Feb 16 15:35 hostdependencies.cfg
-rwxrwxr-x 1 nagios users 664 Feb 16 15:35 hostescalations.cfg
-rwxrwxr-x 1 nagios users 682 Feb 16 15:35 hostextinfo.cfg
-rwxrwxr-x 1 nagios users 990 Feb 16 15:35 hostgroups.cfg
drwxrwxr-x 2 nagios nagios 4096 Feb 16 14:27 hosts
-rwxrwxr-x 1 nagios users 6101 Feb 16 15:35 hosttemplates.cfg
drwxrwxr-x 2 nagios nagios 4096 Feb 15 16:23 import
-rwxrwxr-x 1 nagios users 5714 Feb 15 16:23 nagios.cfg
-rwxrwxr-x 1 nagios users 2229 Jan 11 10:16 ndo2db.cfg
-rwxrwxr-x 1 nagios users 4723 Jan 11 10:16 ndomod.cfg
-rwxrwxr-x 1 nagios users 7207 Jan 11 10:16 nrpe.cfg
-rwxrwxr-x 1 nagios users 5345 Jan 11 10:16 nsca.cfg
drwxrwxr-x 4 nagios nagios 4096 Jan 11 10:16 pnp
-rwxrwxr-x 1 nagios users 210 Jan 11 10:14 resource.cfg
ssawin
Posts: 19
Joined: Wed Feb 10, 2010 12:53 pm

Re: /usr/local/nagios/etc conf files permission

Post by ssawin »

I had the same problelm. I find the at times I need to run this command. then you can save the config again.

chown apache.nagios /usr/local/nagios/etc/*.cfg
spasq01
Posts: 17
Joined: Fri Jun 04, 2010 3:47 pm

Re: /usr/local/nagios/etc conf files permission

Post by spasq01 »

I have to do this every time I make a change to a host or service configuration when using nagios core. Then I write to the files and everything comes back normal again but when I go back to view the hosts or services anything I had just changed shows an Out of Sync status again. Not sure why I have to do this any time I edit a service our host config file. It's quite annoying.
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Re: /usr/local/nagios/etc conf files permission

Post by niebais »

I'm having the same issue. The .cfg files keep reverting back to nagios:nagios and I keep having to chown them to apache:nagios.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: /usr/local/nagios/etc conf files permission

Post by mguthrie »

Some of these issues have be discussed on another thread.

http://support.nagios.com/forum/viewtop ... p=506#p506

Try this solution forwarded from one of our tech team members.

chown -R nagios.nagios /usr/local/nagios/etc
find /usr/local/nagios/etc -type d -exec chmod 775 '{}' + -o\
-type f -exec chmod 664 '{}' +
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Re: /usr/local/nagios/etc conf files permission

Post by niebais »

Lets see what happens :) I just ran the commands.
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Re: /usr/local/nagios/etc conf files permission

Post by niebais »

Ok, when we have an error of some sort and the process rolls back, it appears that the permissions get rolled back to nagios:users. However, that permissions changing script works great otherwise.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: /usr/local/nagios/etc conf files permission

Post by mguthrie »

Yeah, that's something we'll probably have to figure out in future editions, but in the meantime I'm glad that script worked out.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: /usr/local/nagios/etc conf files permission

Post by mmestnik »

What version of NagiosXI?
This should accentually be an obsolete method, replaced by code that was less-likely to change the permissions.
User avatar
niebais
Posts: 349
Joined: Tue Apr 13, 2010 2:15 pm

Re: /usr/local/nagios/etc conf files permission

Post by niebais »

Nagios XI 2009R1.2

It's still a problem. I think there's still some remnants of code that causes permissions problems somewhere. It's happened enough here that I've had to implement a cron job to fix permissions.
Locked