Page 1 of 1
rerun chown nagios:nagcmd /usr/local/nagios/var/rw command
Posted: Tue Aug 16, 2016 9:05 am
by kaushalshriyan
Hi,
I have to rerun the below chown command every time whenever i have to restart the nagios service
chown nagios:nagcmd /usr/local/nagios/var/rw
chown nagios:nagcmd /usr/local/nagios/var/rw/nagios.cmd
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
systemctl restart nagios.service
cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
Nagios Core 4.2.0
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-01-2016
License: GPL
Any help will be highly appreciable.
Regards,
Kaushal
Re: rerun chown nagios:nagcmd /usr/local/nagios/var/rw comma
Posted: Tue Aug 16, 2016 11:27 am
by rkennedy
Can you post the instructions you used when initially installing? It looks like the variables for permissions are getting set on start.
What are they getting set to after you start the service? (before running the chown)
Re: rerun chown nagios:nagcmd /usr/local/nagios/var/rw comma
Posted: Tue Aug 16, 2016 1:04 pm
by kaushalshriyan
Hi Robert,
cat /etc/init.d/nagios ->
http://sprunge.us/dJSU. I am following
http://tecadmin.net/install-nagios-core ... ntos-rhel/. Please correct me if i am doing wrong.
Regards,
Kaushal
Re: rerun chown nagios:nagcmd /usr/local/nagios/var/rw comma
Posted: Tue Aug 16, 2016 5:05 pm
by tgriep
If you do restart the nagios daemon, what do the permissions change to?
Can you run the following and post the output?
Code: Select all
chage -l nagios
grep nag /etc/passwd
grep nag /etc/group
Re: rerun chown nagios:nagcmd /usr/local/nagios/var/rw comma
Posted: Tue Aug 16, 2016 5:07 pm
by scottwilkerson
Also, can you show us the results of
We want to make sure you have the group sticky bit on the directory and the group should be nagios
Code: Select all
drwxrwsr-x 2 nagios nagios 4096 Aug 16 05:59 /usr/local/nagios/var/rw
Additionally your nagios user should be a member of the nagios and nagcmd group
Code: Select all
# cat /etc/group|grep nag
nagios:x:500:nagios,apache
nagcmd:x:501:nagios,apache
Re: rerun chown nagios:nagcmd /usr/local/nagios/var/rw comma
Posted: Wed Aug 17, 2016 2:10 pm
by tgriep
When you compiled Core, did you run the configure command like below?
Code: Select all
./configure --with-command-group=nagcmd
Try and recompiling Core by following this guide and see if that fixes the issue.
https://assets.nagios.com/downloads/nag ... Source.pdf
Is selinux enabled on your server? Run the following command and post the output to see if it is enabled.