Error: Unable to write to check_result_path ('/usr/local/nag

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
dpurtell
Posts: 6
Joined: Wed Aug 12, 2020 10:41 am

Error: Unable to write to check_result_path ('/usr/local/nag

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error: Unable to write to check_result_path ('/usr/local

Post 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

Code: Select all

chage -l nagios
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
dpurtell
Posts: 6
Joined: Wed Aug 12, 2020 10:41 am

Re: Error: Unable to write to check_result_path ('/usr/local

Post 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
dpurtell
Posts: 6
Joined: Wed Aug 12, 2020 10:41 am

Re: Error: Unable to write to check_result_path ('/usr/local

Post by dpurtell »

Additional information - Do not get this permissions error with selinux in permissive mode, only get it when selinux is in enforcing mode.
dpurtell
Posts: 6
Joined: Wed Aug 12, 2020 10:41 am

Re: Error: Unable to write to check_result_path ('/usr/local

Post by dpurtell »

Does anyone have any recommendations?
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Error: Unable to write to check_result_path ('/usr/local

Post 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.
dpurtell
Posts: 6
Joined: Wed Aug 12, 2020 10:41 am

Re: Error: Unable to write to check_result_path ('/usr/local

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