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
rerun chown nagios:nagcmd /usr/local/nagios/var/rw command
-
kaushalshriyan
- Posts: 124
- Joined: Fri May 22, 2015 7:12 am
Re: rerun chown nagios:nagcmd /usr/local/nagios/var/rw comma
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)
What are they getting set to after you start the service? (before running the chown)
Former Nagios Employee
-
kaushalshriyan
- Posts: 124
- Joined: Fri May 22, 2015 7:12 am
Re: rerun chown nagios:nagcmd /usr/local/nagios/var/rw comma
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
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
If you do restart the nagios daemon, what do the permissions change to?
Can you run the following and post the output?
Can you run the following and post the output?
Code: Select all
chage -l nagios
grep nag /etc/passwd
grep nag /etc/groupBe sure to check out our Knowledgebase for helpful articles and solutions!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: rerun chown nagios:nagcmd /usr/local/nagios/var/rw comma
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
Additionally your nagios user should be a member of the nagios and nagcmd group
Code: Select all
ls -ld /usr/local/nagios/var/rwCode: Select all
drwxrwsr-x 2 nagios nagios 4096 Aug 16 05:59 /usr/local/nagios/var/rwCode: Select all
# cat /etc/group|grep nag
nagios:x:500:nagios,apache
nagcmd:x:501:nagios,apache-
kaushalshriyan
- Posts: 124
- Joined: Fri May 22, 2015 7:12 am
Re: rerun chown nagios:nagcmd /usr/local/nagios/var/rw comma
[root@e2e-13-130 nagios]# ls -ld /usr/local/nagios/var/rw
drwxrwsr-x. 2 nagios nagios 4096 Aug 17 08:04 /usr/local/nagios/var/rw
[root@e2e-13-130 nagios]# chage -l nagios
Last password change : Aug 03, 2016
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
[root@e2e-13-130 nagios]# grep nag /etc/passwd
systemd-network
997:996:systemd Network Management:/:/sbin/nologin
nagios
1000
:/home/nagios:/bin/bash
[root@e2e-13-130 nagios]# grep nag /etc/group
nagios
1000:nagios,apache
nagcmd
1001:apache,nagios
[root@e2e-13-130 nagios]# cat /etc/group|grep nag
nagios
1000:nagios,apache
nagcmd
1001:apache,nagios
[root@e2e-13-130 nagios]#
drwxrwsr-x. 2 nagios nagios 4096 Aug 17 08:04 /usr/local/nagios/var/rw
[root@e2e-13-130 nagios]# chage -l nagios
Last password change : Aug 03, 2016
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
[root@e2e-13-130 nagios]# grep nag /etc/passwd
systemd-network
nagios
[root@e2e-13-130 nagios]# grep nag /etc/group
nagios
nagcmd
[root@e2e-13-130 nagios]# cat /etc/group|grep nag
nagios
nagcmd
[root@e2e-13-130 nagios]#
Re: rerun chown nagios:nagcmd /usr/local/nagios/var/rw comma
When you compiled Core, did you run the configure command like below?
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.
Code: Select all
./configure --with-command-group=nagcmdhttps://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.
Code: Select all
getenforceBe sure to check out our Knowledgebase for helpful articles and solutions!