Page 1 of 1

Permission Problem.

Posted: Tue Oct 29, 2013 5:22 am
by veenm
I have installed the nagios core 3.5.1 version on RHEL system using root as a user. Now i want to restart the nagios service as nagios user . When i do that it is giving below error. It is prompting for a password. How can i resolve this. I dont have a root access to on the nagios server now and have to use "nagios" user. Please let me know how we can resolve this.

[nagios@CNPUDAS011 objects]$ service nagios restart
Running configuration check...done.
Stopping nagios: .done.
rm: cannot remove `/var/lock/subsys/nagios': Permission denied
Starting nagios:Password:
touch: cannot touch `/var/lock/subsys/nagios': Permission denied
done.

Re: Permission Problem.

Posted: Tue Oct 29, 2013 11:12 am
by sreinhardt
What permissions are on that file?

Code: Select all

ls -la /var/lock/subsys/nagios

Re: Permission Problem.

Posted: Tue Oct 29, 2013 12:31 pm
by veenm
Is that possible to manage the nagios core using "nagios" as a normal user. Because i have done the whole nagios implementation using "root" . now i dont have a root access to nagios . Now i am logging as a "nagios" user . But when i restart the nagios service it is asking for the password and showing below error.

Re: Permission Problem.

Posted: Tue Oct 29, 2013 12:57 pm
by slansing
Well you should be able to set up and configure nagios just fine with root, I'm not sure what you did to remove access from it?? What error are you getting, can you "su to root?"

Re: Permission Problem.

Posted: Tue Oct 29, 2013 1:22 pm
by veenm
i have not removed the root access . I dont want to restart the nagios service by logging as root user. when i log in as "nagios " user and try to restart the service i am getting the error. please let me know is that possible to restart the nagios service using nagios user . please confirm whether we need root access to restart the nagios service.

Re: Permission Problem.

Posted: Tue Oct 29, 2013 2:13 pm
by lmiltchev
You may have to add a few lines to the /etc/sudoers file, such as:

Code: Select all

nagios ALL = NOPASSWD:/etc/init.d/nagios start
nagios ALL = NOPASSWD:/etc/init.d/nagios stop
nagios ALL = NOPASSWD:/etc/init.d/nagios restart
nagios ALL = NOPASSWD:/etc/init.d/nagios reload
...
Then, you should be able to restart the nagios service as nagios user.