Page 1 of 1

not writable by apache after installed Perl-SDK-6.5

Posted: Fri Apr 26, 2019 6:52 am
by wwthia
After installed VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64 in nagios xi 5.5.10, having errors when apply configuration from the CCM.
Any ideas ?

Also after adding vmware guest, it will not run but if manually "Run Check Command " in services, it works.


Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check
> Return Code: 0
--------------------------------------
..Stopping nagios: .done.
Starting nagios: done.
OUTPUT=Starting nagios: done.
RETURNCODE=0

PROCESSED 1 COMMANDS
PROCESSING COMMAND ID 458...
PROCESS COMMAND: CMD=1150, DATA=remove
CMDLINE=php /usr/local/nagiosxi/html/includes/components/nagiosbpi/api_tool.php --cmd=syncall
PHP Notice: CCM Config File: /usr/local/nagiosxi/etc/components/ccm_config.inc.php is not writable by apache! in /usr/local/nagiosxi/html/includes/components/ccm/ccm.inc.php on line 121
PHP Warning: file_put_contents(/usr/local/nagiosxi/etc/components/bpi.conf): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/components/nagiosbpi/functions/edit_group.inc.php on
line 80
PHP Warning: file_put_contents(/usr/local/nagiosxi/etc/components/bpi.conf): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/components/nagiosbpi/functions/edit_group.inc.php on
line 80
PHP Warning: file_put_contents(/usr/local/nagiosxi/etc/components/bpi.conf): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/components/nagiosbpi/functions/edit_group.inc.php on
line 80
PHP Warning: file_put_contents(/usr/local/nagiosxi/etc/components/bpi.conf): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/components/nagiosbpi/functions/edit_group.inc.php on
line 80
PHP Warning: file_put_contents(/usr/local/nagiosxi/etc/components/bpi.conf): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/components/nagiosbpi/functions/edit_group.inc.php on
line 80
PHP Warning: file_put_contents(/usr/local/nagiosxi/etc/components/bpi.conf): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/components/nagiosbpi/functions/edit_group.inc.php on
line 80
PHP Warning: file_put_contents(/usr/local/nagiosxi/etc/components/bpi.conf): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/components/nagiosbpi/functions/edit_group.inc.php on
line 80
PHP Warning: file_put_contents(/usr/local/nagiosxi/etc/components/bpi.conf): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/components/nagiosbpi/functions/edit_group.inc.php on
line 80
PHP Warning: file_put_contents(/usr/local/nagiosxi/etc/components/bpi.conf): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/components/nagiosbpi/functions/edit_group.inc.php on
line 80
PHP Warning: file_put_contents(/usr/local/nagiosxi/etc/components/bpi.conf): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/components/nagiosbpi/functions/edit_group.inc.php on
line 80
PHP Warning: file_put_contents(/usr/local/nagiosxi/etc/components/bpi.conf): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/components/nagiosbpi/functions/edit_group.inc.php on
line 80
PHP Warning: file_put_contents(/usr/local/nagiosxi/etc/components/bpi.conf): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/components/nagiosbpi/functions/edit_group.inc.php on
line 80
PHP Warning: file_put_contents(/usr/local/nagiosxi/etc/components/bpi.conf): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/components/nagiosbpi/functions/delete_group.inc.php
on line 105
<p class="error">Missing data from required fields. Please go back and complete all fields.</p>Member: localhost;Root Partition removed!
PHP Warning: file_put_contents(/usr/local/nagiosxi/etc/components/bpi.conf): failed to open stream: Permission denied in /usr/local/nagiosxi/html/includes/components/nagiosbpi/functions/edit_group.inc.php on
line 80
CMD: syncall
MSG: Config file is not writeable! Config file is not writeable!
OUTPUT=MSG: Config file is not writeable! Config file is not writeable!
RETURNCODE=2
........
PROCESSED 1 COMMANDS
.............................................................
PROCESSED 0 COMMANDS

Re: not writable by apache after installed Perl-SDK-6.5

Posted: Fri Apr 26, 2019 7:39 am
by scottwilkerson
Can you show the permissions of these

Code: Select all

ls -l /usr/local/nagiosxi/etc/components/ccm_config.inc.php
ls -l /usr/local/nagiosxi/etc/components/bpi.conf
also what is the output of the following commands

Code: Select all

getenforce
grep nag /etc/group

Re: not writable by apache after installed Perl-SDK-6.5

Posted: Fri Apr 26, 2019 10:20 am
by wwthia
scottwilkerson wrote:Can you show the permissions of these

Code: Select all

ls -l /usr/local/nagiosxi/etc/components/ccm_config.inc.php
ls -l /usr/local/nagiosxi/etc/components/bpi.conf
also what is the output of the following commands

Code: Select all

getenforce
grep nag /etc/group
Thanks for the quick response :)

-rw-rw-r-- 1 apache nagios 650 Feb 26 14:38 /usr/local/nagiosxi/etc/components/ccm_config.inc.php
-rw-rw-r-- 1 apache nagios 7565 Apr 10 15:38 /usr/local/nagiosxi/etc/components/bpi.conf

# getenforce
Disabled
# grep nag /etc/group
nagios:x:500:nagios,apache,snmptt
nagcmd:x:501:nagios,apache,snmptt
#

Re: not writable by apache after installed Perl-SDK-6.5

Posted: Fri Apr 26, 2019 12:14 pm
by scottwilkerson
Hmm, those permissions look ok, it must be higher in the tree

Please show the output of the following:

Code: Select all

ls -ld /usr/local/nagiosxi/etc/components
ls -ld /usr/local/nagiosxi/etc
ls -ld /usr/local/nagiosxi
ls -ld /usr/local
ls -ld /usr

Re: not writable by apache after installed Perl-SDK-6.5

Posted: Fri Apr 26, 2019 7:54 pm
by wwthia
scottwilkerson wrote:Hmm, those permissions look ok, it must be higher in the tree

Please show the output of the following:

Code: Select all

ls -ld /usr/local/nagiosxi/etc/components
ls -ld /usr/local/nagiosxi/etc
ls -ld /usr/local/nagiosxi
ls -ld /usr/local
ls -ld /usr

# ls -ld /usr/local/nagiosxi/etc/components/
drwsrwsr-x 4 apache nagios 4096 Apr 27 00:11 /usr/local/nagiosxi/etc/components/

# ls -ld /usr/local/nagiosxi/etc/
drwxr-xr-x 3 nagios nagios 4096 Feb 20 2016 /usr/local/nagiosxi/etc/

# ls -ld /usr/local/nagiosxi/
drwxr-xr-x 10 nagios nagios 4096 Feb 20 2016 /usr/local/nagiosxi/

# ls -ld /usr/local/
drwxr-xr-x. 20 root root 4096 Feb 26 14:29 /usr/local/

# ls -ld /usr/
drwxr-xr-x. 13 root root 4096 Apr 5 2013 /usr/

Re: not writable by apache after installed Perl-SDK-6.5

Posted: Fri Apr 26, 2019 9:43 pm
by wwthia
Reverted to an early vm snapshot and the problem was already there before the vmware perl installation.
Same error code from /usr/local/nagiosxi/var/cmdsubsys.log

Write host configurations ...
Host configuration files successfully written!

Write service configurations ...
Service configuration files successfully written!

Cannot open/overwrite the configuration file (check the permissions)!
Cannot open/overwrite the configuration file (check the permissions)!
Cannot open/overwrite the configuration file (check the permissions)!

Re: not writable by apache after installed Perl-SDK-6.5

Posted: Sun Apr 28, 2019 11:31 pm
by wwthia
Problem resolved.

Had started NIS in nagios server and it have changed the group id of nagcmd in : /usr/local/nagios/var/rw
which caused permission denied.

Re: not writable by apache after installed Perl-SDK-6.5

Posted: Mon Apr 29, 2019 6:18 am
by scottwilkerson
wwthia wrote:Problem resolved.

Had started NIS in nagios server and it have changed the group id of nagcmd in : /usr/local/nagios/var/rw
which caused permission denied.
Glad to hear it is resolved!

Locking thread