Page 1 of 1
Unconfigured objects "permission denied" error
Posted: Mon Oct 29, 2012 6:14 pm
by nagiosadmin42
Nagios XI 2012R1.0, CentOS 6.3
I'm trying to use the Unconfigured Objects page to delete passive services that aren't being used. When I click the X in the host's row to delete all services listed for that host, the page redisplays and the header says "Objects deleted." however, they still appear on the page.
I found this entry in the web server error log that may point to the cause:
Code: Select all
[Mon Oct 29 16:00:24 2012] [error] [client 192.168.0.62] PHP Warning: file_put_contents(/usr/local/nagiosxi/var/corelog.newobjects):
failed to open stream: Permission denied in /usr/local/nagiosxi/html/admin/missingobjects.php on line 138
And the files on disk have the following permissions:
Code: Select all
# ll /usr/local/nagiosxi/var/core*
-rw-r--r--. 1 nagios users 8 Oct 29 16:09 /usr/local/nagiosxi/var/corelog.data
-rw-r--r--. 1 nagios users 0 Oct 29 16:09 /usr/local/nagiosxi/var/corelog.diff
-rwxrwxr-x. 1 nagios users 8906 Oct 29 16:09 /usr/local/nagiosxi/var/corelog.newobjects
Re: Unconfigured objects "permission denied" error
Posted: Tue Oct 30, 2012 9:21 am
by mguthrie
Hmm, permissions look right on that file. Is SELinux enabled?
Just for debugging purposes, does the file write work if it's set to 777 permissions?
Code: Select all
chmod 777 /usr/local/nagiosxi/var/corelog.newobjects
Re: Unconfigured objects "permission denied" error
Posted: Tue Oct 30, 2012 10:13 am
by nagiosadmin42
Changing corelog.newobjects permissions to 777 doesn't help, the same error is generated and its permissions are reset to 775 automatically.
Where do I check for that SELinux setting you mentioned?
Re: Unconfigured objects "permission denied" error
Posted: Tue Oct 30, 2012 11:02 am
by mguthrie
We disable SELinux in our installer because it has a tendency to silently break things. The config file for it is /etc/selinux/config.
Do you get any errors in the apache log when you run the following script?
Code: Select all
/usr/local/nagiosxi/scripts/parse_core_eventlog.php
Re: Unconfigured objects "permission denied" error
Posted: Tue Oct 30, 2012 11:04 am
by lmiltchev
Run the following commands, and post the output:
Code: Select all
cat /etc/group | grep nag
chage -l apache; chage -l nagios
Re: Unconfigured objects "permission denied" error
Posted: Tue Oct 30, 2012 11:15 am
by nagiosadmin42
1) Here's the content of /etc/selinux/config:
Code: Select all
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0
2) No errors are generated in /var/log/httpd/error_log when I ran /usr/local/nagiosxi/scripts/parse_core_eventlog.php as root from the console.
3) Here's the output of the other commands:
Code: Select all
# cat /etc/group | grep nag
nagios:x:501:nagios,apache
nagcmd:x:502:nagios,apache
# chage -l apache
Last password change : Oct 16, 2012
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : -1
Maximum number of days between password change : -1
Number of days of warning before password expires : -1
# chage -l nagios
Last password change : Oct 16, 2012
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
Re: Unconfigured objects "permission denied" error
Posted: Tue Oct 30, 2012 1:41 pm
by mguthrie
We did make some updates/fixes to the unconfigured objects page for the 1.1 release. Not sure if an upgrade is plausible in the near future, but if it's not we can send the patched files from the new version and see if that fixes the issue.
Re: Unconfigured objects "permission denied" error
Posted: Tue Oct 30, 2012 3:49 pm
by nagiosadmin42
I just upgraded to 2012R1.1 and am now able to delete the unconfigured objects by clicking on the "X" in the host's entry.
Thank you very much!
Alan