BAD CHECK RESULTS DIR

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: BAD CHECK RESULTS DIR

Post 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 ..
Previous Nagios employee
onegative
Posts: 175
Joined: Tue Feb 17, 2015 12:06 pm

Re: BAD CHECK RESULTS DIR

Post 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
onegative
Posts: 175
Joined: Tue Feb 17, 2015 12:06 pm

Re: BAD CHECK RESULTS DIR

Post 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 ..
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: BAD CHECK RESULTS DIR

Post 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
onegative
Posts: 175
Joined: Tue Feb 17, 2015 12:06 pm

Re: BAD CHECK RESULTS DIR

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: BAD CHECK RESULTS DIR

Post by ssax »

No problem, thanks for reporting it! Are we okay to mark this as resolved and lock the topic?
onegative
Posts: 175
Joined: Tue Feb 17, 2015 12:06 pm

Re: BAD CHECK RESULTS DIR

Post by onegative »

Yes resolved and thanks...
Locked