Changed path permission accidentally(Unable to get process)
Posted: Wed Apr 15, 2015 1:20 am
I am in a serious problem. I was unable to change nagios files using a user. So, changed file permission & created a group. But after that NAGIOS isn't getting process status.
I have executed following commands.
groupadd local_users
usermod -a -G local_users sabuj
chown -R root:local_users /usr/local
chmod -R 2775 /usr/local
find /usr/local -type f -exec chmod 0774 '{}' \;
Then i have changed /usr/local/nagios path to nagios group:
root@RR-DE-NMS-1:/usr/local# ls -lrt
total 36
drwxrwsr-x 2 root local_users 4096 Feb 18 20:33 src
drwxrwsr-x 2 root local_users 4096 Feb 18 20:33 sbin
drwxrwsr-x 2 root local_users 4096 Feb 18 20:33 include
drwxrwsr-x 2 root local_users 4096 Feb 18 20:33 games
drwxrwsr-x 2 root local_users 4096 Feb 18 20:33 etc
drwxrwsr-x 2 root local_users 4096 Feb 18 20:33 bin
lrwxrwxrwx 1 root local_users 9 Apr 7 09:31 man -> share/man
drwxrwsr-x 4 root local_users 4096 Apr 7 09:35 lib
drwxrwsr-x 7 root local_users 4096 Apr 7 11:03 share
drwxrwsr-x 9 nagios nagios 4096 Apr 7 11:26 nagios
root@RR-DE-NMS-1:/usr/local/nagios# ll
total 36
drwxrwsr-x 9 nagios nagios 4096 Apr 7 11:26 ./
drwxrwsr-x 11 root local_users 4096 Apr 7 11:11 ../
drwxrwsr-x 2 nagios nagios 4096 Apr 7 15:06 bin/
drwxrwsr-x 3 nagios nagios 4096 Apr 14 18:49 etc/
drwxrwsr-x 2 nagios nagios 4096 Apr 7 11:26 include/
drwxrwsr-x 3 nagios nagios 4096 Apr 7 11:26 libexec/
drwxrwsr-x 2 nagios nagios 4096 Apr 7 15:06 sbin/
drwxrwsr-x 11 nagios nagios 4096 Apr 7 15:06 share/
drwxrwsr-x 5 nagios nagios 4096 Apr 14 20:20 var/
I have added nagios user into local_user group. But no result. Do, i need to add some more user? In that case i want to undone it.
But i have checked pre-flight checking & everything is ok.
root@RR-DE-NMS-1:/usr/local/nagios# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 8 services.
Checked 7 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 7 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
How i can undone it? Please reply ASAP>>>>
I have executed following commands.
groupadd local_users
usermod -a -G local_users sabuj
chown -R root:local_users /usr/local
chmod -R 2775 /usr/local
find /usr/local -type f -exec chmod 0774 '{}' \;
Then i have changed /usr/local/nagios path to nagios group:
root@RR-DE-NMS-1:/usr/local# ls -lrt
total 36
drwxrwsr-x 2 root local_users 4096 Feb 18 20:33 src
drwxrwsr-x 2 root local_users 4096 Feb 18 20:33 sbin
drwxrwsr-x 2 root local_users 4096 Feb 18 20:33 include
drwxrwsr-x 2 root local_users 4096 Feb 18 20:33 games
drwxrwsr-x 2 root local_users 4096 Feb 18 20:33 etc
drwxrwsr-x 2 root local_users 4096 Feb 18 20:33 bin
lrwxrwxrwx 1 root local_users 9 Apr 7 09:31 man -> share/man
drwxrwsr-x 4 root local_users 4096 Apr 7 09:35 lib
drwxrwsr-x 7 root local_users 4096 Apr 7 11:03 share
drwxrwsr-x 9 nagios nagios 4096 Apr 7 11:26 nagios
root@RR-DE-NMS-1:/usr/local/nagios# ll
total 36
drwxrwsr-x 9 nagios nagios 4096 Apr 7 11:26 ./
drwxrwsr-x 11 root local_users 4096 Apr 7 11:11 ../
drwxrwsr-x 2 nagios nagios 4096 Apr 7 15:06 bin/
drwxrwsr-x 3 nagios nagios 4096 Apr 14 18:49 etc/
drwxrwsr-x 2 nagios nagios 4096 Apr 7 11:26 include/
drwxrwsr-x 3 nagios nagios 4096 Apr 7 11:26 libexec/
drwxrwsr-x 2 nagios nagios 4096 Apr 7 15:06 sbin/
drwxrwsr-x 11 nagios nagios 4096 Apr 7 15:06 share/
drwxrwsr-x 5 nagios nagios 4096 Apr 14 20:20 var/
I have added nagios user into local_user group. But no result. Do, i need to add some more user? In that case i want to undone it.
But i have checked pre-flight checking & everything is ok.
root@RR-DE-NMS-1:/usr/local/nagios# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 8 services.
Checked 7 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 7 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
How i can undone it? Please reply ASAP>>>>