Unconfigured objects "permission denied" error

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nagiosadmin42
Posts: 96
Joined: Sat Feb 11, 2012 2:16 pm

Unconfigured objects "permission denied" error

Post 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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Unconfigured objects "permission denied" error

Post by mguthrie »

Hmm, permissions look right on that file. Is SELinux enabled?

Code: Select all

setenforce 0
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
nagiosadmin42
Posts: 96
Joined: Sat Feb 11, 2012 2:16 pm

Re: Unconfigured objects "permission denied" error

Post 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?
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Unconfigured objects "permission denied" error

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unconfigured objects "permission denied" error

Post by lmiltchev »

Run the following commands, and post the output:

Code: Select all

cat /etc/group | grep nag
 chage -l apache; chage -l nagios
Be sure to check out our Knowledgebase for helpful articles and solutions!
nagiosadmin42
Posts: 96
Joined: Sat Feb 11, 2012 2:16 pm

Re: Unconfigured objects "permission denied" error

Post 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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Unconfigured objects "permission denied" error

Post 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.
nagiosadmin42
Posts: 96
Joined: Sat Feb 11, 2012 2:16 pm

Re: Unconfigured objects "permission denied" error

Post 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
Locked