Page 1 of 1
Error: Unable to write to check_result_path ('/usr/local/nag
Posted: Thu Sep 03, 2020 10:48 am
by dpurtell
Running nagios core 4.4.3 and NagiosQL 3.4.0 RHEL7 Linux
Running the command prompt confuration files check runs successfully without issue, but running the Tools/Nagios control/Check configuration files button returns this error Error: Unable to write to check_result_path ('/usr/local/nagios/var/spool/checkresults') - Permission denied
Linux folder permissions appear to be ok.
Any assistance that can be provided would be appreciated.
Re: Error: Unable to write to check_result_path ('/usr/local
Posted: Thu Sep 03, 2020 10:57 am
by scottwilkerson
Can you show the permissions of the following
Code: Select all
ls -ld /usr/local/nagios/var/spool/checkresults
ls -ld /usr/local/nagios/var/spool
ls -ld /usr/local/nagios/var
ls -ld /usr/local/nagios
and
Re: Error: Unable to write to check_result_path ('/usr/local
Posted: Thu Sep 03, 2020 11:02 am
by dpurtell
# ls -ld /usr/local/nagios/var/spool/checkresults
drwxrws---. 2 nagios nagios 6 Sep 1 14:33 /usr/local/nagios/var/spool/checkresults
# ls -ld /usr/local/nagios/var/spool
drwxrwxrw-. 3 nagios nagios 26 Jun 10 2019 /usr/local/nagios/var/spool
# ls -ld /usr/local/nagios/var
drwxrwxr-x. 5 nagios nagios 191 Sep 3 10:59 /usr/local/nagios/var
# ls -ld /usr/local/nagios
drwxr-xr-x. 9 root root 94 Jun 10 2019 /usr/local/nagios
# chage -l nagios
Last password change : Jun 17, 2019
Password expires : Aug 16, 2019
Password inactive : Aug 16, 2019
Account expires : never
Minimum number of days between password change : 1
Maximum number of days between password change : 60
Number of days of warning before password expires : 7
Re: Error: Unable to write to check_result_path ('/usr/local
Posted: Thu Sep 03, 2020 2:02 pm
by dpurtell
Additional information - Do not get this permissions error with selinux in permissive mode, only get it when selinux is in enforcing mode.
Re: Error: Unable to write to check_result_path ('/usr/local
Posted: Fri Oct 30, 2020 11:04 am
by dpurtell
Does anyone have any recommendations?
Re: Error: Unable to write to check_result_path ('/usr/local
Posted: Tue Nov 03, 2020 1:07 pm
by gormank
I think you found the cause is selinux. I've gone through the /var/log/messages file in the past and done what it recommends to allow access for things.
Re: Error: Unable to write to check_result_path ('/usr/local
Posted: Tue Nov 24, 2020 12:46 pm
by dpurtell
Resolved this write issue with the following commands:
chcon -R -t httpd_sys_script_exec_t /usr/local/nagios/sbin
chcon -R -t httpd_sys_script_exec_t /usr/local/nagios/bin
chcon -R -t bin_t /usr/local/nagios/bin/nagios
/sbin/restorecon -v /usr/local/nagios/bin/nagios
semanage fcontext -a -t httpd_sys_script_exec_t /usr/local/nagios/sbin
semanage fcontext -a -t httpd_sys_script_exec_t /usr/local/nagios/bin
and
chcon -R -t httpd_sys_script_exec_t /usr/local/nagios/var/spool
/sbin/restorecon -v /usr/local/nagios/var/spool