Page 2 of 2

Re: BAD CHECK RESULTS DIR

Posted: Wed Feb 01, 2017 5:53 pm
by avandemore
Your permissions seem off. Here is what the default is:

Code: Select all

# ls -la /usr/local/nagios/var/spool/checkresults
total 0
drwxrwsr-x. 2 nagios nagios  6 Feb  1 13:49 .
drwxr-xr-x. 5 nagios nagios 52 Jan 25 10:05 ..

Re: BAD CHECK RESULTS DIR

Posted: Thu Feb 02, 2017 11:39 am
by onegative
Before running the chmod 775 on /opt I tried something specific...

I modified checkresults in /usr/local/nrdp/server/config.inc.php to $cfg["check_results_dir"]="/opt/nagios/var/spool/checkresults";
and it works fine and creates the results files...but using the symbolic embedded link path $cfg["check_results_dir"]="/usr/local/nagios/var/spool/checkresults"; it fails with the BAD CHECK RESULTS DIR

Symbolic links provide no permission bits and rely upon the underlying file permissions which makes me wonder what's actually happening here.

I tried issuing the `chmod 755 /opt` and then re-defining the checkresults path to include the symbolic link /usr/local/... but it still fails with the BAD CHECK RESULTS DIR

Since I cannot see the source code associated with how the write command is specifying the path of the write its really hard understanding what is really happening here...

Is there no way to place whatever process/function in debug mode to get a clear picture as to why its failing?
Or is there a specific log that might be reporting what the function is actually experiencing...I have looked in the standard nagios.log and apache logs to no avail.

Let me know and thanks,
Danny

Re: BAD CHECK RESULTS DIR

Posted: Thu Feb 02, 2017 11:42 am
by onegative
This is what I am seeing...again if I use the hard path /opt (works) as opposed to the link path /usr/local (fails)

[root@its-nagios-d1 logs]# ls -la /usr/local/nagios/var/spool/checkresults
total 8
drwxrwsr-x 2 nagios nagcmd 4096 Feb 2 08:34 .
drwxr-xr-x 5 nagios nagios 4096 Nov 3 2015 ..

[root@its-nagios-d1 logs]# ls -la /opt/nagios/var/spool/checkresults
total 8
drwxrwsr-x 2 nagios nagcmd 4096 Feb 2 08:34 .
drwxr-xr-x 5 nagios nagios 4096 Nov 3 2015 ..

Re: BAD CHECK RESULTS DIR

Posted: Thu Feb 02, 2017 1:04 pm
by ssax
Looks like this is a limitation in PHP's file_exists function:

http://php.net/manual/en/function.file-exists.php#73904

I am unable to get it to work without setting it to /opt like you did, so you will need to change the locations that I mentioned previously to use /opt in the path. I've created a bug report here:

Code: Select all

https://github.com/NagiosEnterprises/nrdp/issues/13
Let me know if you have any questions.


Thank you

Re: BAD CHECK RESULTS DIR

Posted: Thu Feb 02, 2017 3:46 pm
by onegative
Outstanding...that is exactly what I was attempting to ascertain. This explains the failure to a tee.
Thanks every one for their responses and input...I appreciate you all helping me understand...

Sincerely,
Danny

Re: BAD CHECK RESULTS DIR

Posted: Thu Feb 02, 2017 5:05 pm
by ssax
No problem, thanks for reporting it! Are we okay to mark this as resolved and lock the topic?

Re: BAD CHECK RESULTS DIR

Posted: Fri Feb 03, 2017 10:05 am
by onegative
Yes resolved and thanks...