BAD CHECK RESULTS DIR
BAD CHECK RESULTS DIR
G ' Day Customer Support,
I am having a real problem getting NRDP to function with my current version of Nagios XI (5.4.1). I have tried and followed the instructions posted in the NRDP Overview guide but it lacks specifics and details that seem important. I have configured the NRDP server accordingly and can establish the following web url to try testing.
https://myIpAddr/nrdp
Which returns a small form with Submit Nagios Command which succeeds by disabling/enabling host notifications...and returns the following:
<result><status>0</status><message>OK</message></result>
But when I attempt to utilize this web form to Submit Check Data it fails and returns the following:
<result><status>-1</status><message>BAD CHECK RESULTS DIR</message></result>
I know communications are functioning because if I use a bad token or leave empty I get the appropriate response...
Also when using the latest NCPA [passive checks] the same results in the log occur...as shown below...
2017-01-31 13:49:31,463 28775 INFO Running check: cpu/percent --warning 60 --critical 80 --aggregate avg
2017-01-31 13:49:32,493 28775 WARNING XML returned did not contain a message, or was malformed.
2017-01-31 13:49:32,493 28775 INFO Message from NRDP server: BAD CHECK RESULTS DIR
2017-01-31 13:49:32,494 28775 INFO Meta output from NRDP server: Nonexistent
2017-01-31 13:50:01,538 28775 INFO Running check: cpu/percent --warning 60 --critical 80 --aggregate avg
2017-01-31 13:50:02,570 28775 WARNING XML returned did not contain a message, or was malformed.
2017-01-31 13:50:02,570 28775 INFO Message from NRDP server: BAD CHECK RESULTS DIR
2017-01-31 13:50:02,570 28775 INFO Meta output from NRDP server: Nonexistent
2017-01-31 13:50:31,613 28775 INFO Running check: cpu/percent --warning 60 --critical 80 --aggregate avg
2017-01-31 13:50:32,640 28775 WARNING XML returned did not contain a message, or was malformed.
2017-01-31 13:50:32,640 28775 INFO Message from NRDP server: BAD CHECK RESULTS DIR
2017-01-31 13:50:32,641 28775 INFO Meta output from NRDP server: Nonexistent
Can anyone provide some feedback as to why this is happening? I would like to know what this error "BAD CHECK RESULTS DIR" is indicating? The author/developer should be able to describe what conditions results in this response.
Any and all help would be greatly appreciated...
Thanks,
Danny
I am having a real problem getting NRDP to function with my current version of Nagios XI (5.4.1). I have tried and followed the instructions posted in the NRDP Overview guide but it lacks specifics and details that seem important. I have configured the NRDP server accordingly and can establish the following web url to try testing.
https://myIpAddr/nrdp
Which returns a small form with Submit Nagios Command which succeeds by disabling/enabling host notifications...and returns the following:
<result><status>0</status><message>OK</message></result>
But when I attempt to utilize this web form to Submit Check Data it fails and returns the following:
<result><status>-1</status><message>BAD CHECK RESULTS DIR</message></result>
I know communications are functioning because if I use a bad token or leave empty I get the appropriate response...
Also when using the latest NCPA [passive checks] the same results in the log occur...as shown below...
2017-01-31 13:49:31,463 28775 INFO Running check: cpu/percent --warning 60 --critical 80 --aggregate avg
2017-01-31 13:49:32,493 28775 WARNING XML returned did not contain a message, or was malformed.
2017-01-31 13:49:32,493 28775 INFO Message from NRDP server: BAD CHECK RESULTS DIR
2017-01-31 13:49:32,494 28775 INFO Meta output from NRDP server: Nonexistent
2017-01-31 13:50:01,538 28775 INFO Running check: cpu/percent --warning 60 --critical 80 --aggregate avg
2017-01-31 13:50:02,570 28775 WARNING XML returned did not contain a message, or was malformed.
2017-01-31 13:50:02,570 28775 INFO Message from NRDP server: BAD CHECK RESULTS DIR
2017-01-31 13:50:02,570 28775 INFO Meta output from NRDP server: Nonexistent
2017-01-31 13:50:31,613 28775 INFO Running check: cpu/percent --warning 60 --critical 80 --aggregate avg
2017-01-31 13:50:32,640 28775 WARNING XML returned did not contain a message, or was malformed.
2017-01-31 13:50:32,640 28775 INFO Message from NRDP server: BAD CHECK RESULTS DIR
2017-01-31 13:50:32,641 28775 INFO Meta output from NRDP server: Nonexistent
Can anyone provide some feedback as to why this is happening? I would like to know what this error "BAD CHECK RESULTS DIR" is indicating? The author/developer should be able to describe what conditions results in this response.
Any and all help would be greatly appreciated...
Thanks,
Danny
Last edited by onegative on Thu Feb 02, 2017 5:24 pm, edited 1 time in total.
Re: BAD CHECK RESULTS DIR
The following file is the Configuration file for the NRDP server. Take a look at it and verify that the folders exist and that the permissions are correct.
This is the option that specifies where the results are stored and the nagios user and group need to have full access to that folder and well as the Apache user needs to be part of the nagios group.
If you have any questions on this, can you post your /usr/local/nrdp/server/config.inc.php from the server as well as the output from these commands.
Code: Select all
/usr/local/nrdp/server/config.inc.phpCode: Select all
$cfg["check_results_dir"]Code: Select all
chage -l nagios
grep nag /etc/groupBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: BAD CHECK RESULTS DIR
Hey tgriep,
Yes I have verified all of these...thought of this first before opening request. Seems like it is not using the checkresults DIR...yes agreed...but not sure why...I can go to the checkresults directory as nagios and touch a file so writing to it does not seem to be the issue???
[nagios@its-nagios-d1 server]$ pwd
/usr/local/nrdp/server
[nagios@its-nagios-d1 server]$ ls -l
total 16
-rwxrwxr-- 1 nagios nagios 2093 Jan 31 13:26 config.inc.php
drwxr-xr-x 2 nagios nagios 4096 Feb 1 10:18 includes
-rw-r--r-- 1 nagios nagios 2810 Jan 4 11:25 index.php
drwxr-xr-x 5 nagios nagios 4096 Nov 3 2015 plugins
$cfg["check_results_dir"]="/usr/local/nagios/var/spool/checkresults";
[nagios@its-nagios-d1 checkresults]$ id
uid=1144(nagios) gid=1144(nagios) groups=1144(nagios),1145(nagcmd)
[nagios@its-nagios-d1 usr]$ pwd
/usr
[nagios@its-nagios-d1 usr]$ ls -la | grep "\.$"
drwxr-xr-x. 13 root root 4096 Oct 20 2015 .
dr-xr-xr-x. 25 root root 4096 Jul 22 2016 ..
[nagios@its-nagios-d1 usr]$ cd local
[nagios@its-nagios-d1 local]$ pwd
/usr/local
[nagios@its-nagios-d1 local]$ ls -la | grep "\.$"
drwxr-xr-x. 24 root root 4096 Jan 4 11:44 .
dr-xr-xr-x. 25 root root 4096 Jul 22 2016 ..
[nagios@its-nagios-d1 local]$ cd nagios
[nagios@its-nagios-d1 nagios]$ pwd
/usr/local/nagios
[nagios@its-nagios-d1 nagios]$ ls -la | grep "\.$"
drwxr-xr-x 9 nagios nagios 4096 Nov 3 2015 .
drwxr-xr-x. 24 root root 4096 Jan 4 11:44 ..
[nagios@its-nagios-d1 nagios]$ cd var
[nagios@its-nagios-d1 var]$ pwd
/usr/local/nagios/var
[nagios@its-nagios-d1 var]$ ls -la | grep "\.$"
drwxrwxr-x 6 nagios nagios 4096 Feb 1 10:33 .
drwxr-xr-x 9 nagios nagios 4096 Nov 3 2015 ..
[nagios@its-nagios-d1 var]$ cd spool
[nagios@its-nagios-d1 spool]$ pwd
/usr/local/nagios/var/spool
[nagios@its-nagios-d1 spool]$ ls -la | grep "\.$"
drwxr-xr-x 5 nagios nagios 4096 Nov 3 2015 .
drwxrwxr-x 6 nagios nagios 4096 Feb 1 10:33 ..
[nagios@its-nagios-d1 spool]$ cd checkresults
[nagios@its-nagios-d1 checkresults]$ pwd
/usr/local/nagios/var/spool/checkresults
[nagios@its-nagios-d1 checkresults]$ ls -la | grep "\.$"
drwxrwsr-x 2 nagios nagcmd 4096 Feb 1 10:12 .
drwxr-xr-x 5 nagios nagios 4096 Nov 3 2015 ..
[nagios@its-nagios-d1 server]$ chage -l nagios
Last password change : Nov 03, 2015
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
[nagios@its-nagios-d1 server]$ grep nag /etc/group
nagios
1144:nagios,apache,snmptt
nagcmd
1145:nagios,apache,snmptt
Yes I have verified all of these...thought of this first before opening request. Seems like it is not using the checkresults DIR...yes agreed...but not sure why...I can go to the checkresults directory as nagios and touch a file so writing to it does not seem to be the issue???
[nagios@its-nagios-d1 server]$ pwd
/usr/local/nrdp/server
[nagios@its-nagios-d1 server]$ ls -l
total 16
-rwxrwxr-- 1 nagios nagios 2093 Jan 31 13:26 config.inc.php
drwxr-xr-x 2 nagios nagios 4096 Feb 1 10:18 includes
-rw-r--r-- 1 nagios nagios 2810 Jan 4 11:25 index.php
drwxr-xr-x 5 nagios nagios 4096 Nov 3 2015 plugins
$cfg["check_results_dir"]="/usr/local/nagios/var/spool/checkresults";
[nagios@its-nagios-d1 checkresults]$ id
uid=1144(nagios) gid=1144(nagios) groups=1144(nagios),1145(nagcmd)
[nagios@its-nagios-d1 usr]$ pwd
/usr
[nagios@its-nagios-d1 usr]$ ls -la | grep "\.$"
drwxr-xr-x. 13 root root 4096 Oct 20 2015 .
dr-xr-xr-x. 25 root root 4096 Jul 22 2016 ..
[nagios@its-nagios-d1 usr]$ cd local
[nagios@its-nagios-d1 local]$ pwd
/usr/local
[nagios@its-nagios-d1 local]$ ls -la | grep "\.$"
drwxr-xr-x. 24 root root 4096 Jan 4 11:44 .
dr-xr-xr-x. 25 root root 4096 Jul 22 2016 ..
[nagios@its-nagios-d1 local]$ cd nagios
[nagios@its-nagios-d1 nagios]$ pwd
/usr/local/nagios
[nagios@its-nagios-d1 nagios]$ ls -la | grep "\.$"
drwxr-xr-x 9 nagios nagios 4096 Nov 3 2015 .
drwxr-xr-x. 24 root root 4096 Jan 4 11:44 ..
[nagios@its-nagios-d1 nagios]$ cd var
[nagios@its-nagios-d1 var]$ pwd
/usr/local/nagios/var
[nagios@its-nagios-d1 var]$ ls -la | grep "\.$"
drwxrwxr-x 6 nagios nagios 4096 Feb 1 10:33 .
drwxr-xr-x 9 nagios nagios 4096 Nov 3 2015 ..
[nagios@its-nagios-d1 var]$ cd spool
[nagios@its-nagios-d1 spool]$ pwd
/usr/local/nagios/var/spool
[nagios@its-nagios-d1 spool]$ ls -la | grep "\.$"
drwxr-xr-x 5 nagios nagios 4096 Nov 3 2015 .
drwxrwxr-x 6 nagios nagios 4096 Feb 1 10:33 ..
[nagios@its-nagios-d1 spool]$ cd checkresults
[nagios@its-nagios-d1 checkresults]$ pwd
/usr/local/nagios/var/spool/checkresults
[nagios@its-nagios-d1 checkresults]$ ls -la | grep "\.$"
drwxrwsr-x 2 nagios nagcmd 4096 Feb 1 10:12 .
drwxr-xr-x 5 nagios nagios 4096 Nov 3 2015 ..
[nagios@its-nagios-d1 server]$ chage -l nagios
Last password change : Nov 03, 2015
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7
[nagios@its-nagios-d1 server]$ grep nag /etc/group
nagios
nagcmd
You do not have the required permissions to view the files attached to this post.
Re: BAD CHECK RESULTS DIR
Do you have a RAMDisk setup by chance?
Code: Select all
grep ramdisk /usr/local/nagios/etc/nagios.cfgRe: BAD CHECK RESULTS DIR
No RAMDisk defined...
[nagios@its-nagios-d1 usr]$ grep -ic ramdisk /usr/local/nagios/etc/nagios.cfg
0
The only thing that might be different with regard to disk is the fact that I do not have much space on /usr
So I have created a symbolic link from /usr/local -------> /opt
[nagios@its-nagios-d1 usr]$ pwd
/usr
[nagios@its-nagios-d1 usr]$ ls -l local
lrwxrwxrwx 1 root root 4 Oct 20 2015 local -> /opt
But the permissions are opened to allow...perhaps if coding within the nrdp server might be using relative paths to find certain files/directories I guess that might cause the issue...that would make me cry though. Using relative paths to look for things is not a good way to code IMHO because it introduces possible conflicts such as linking between available filesystems.
I guess I could try modifying the checkresults dir to something like /tmp/checkresults for testing...but that really bothers me.
Danny
[nagios@its-nagios-d1 usr]$ grep -ic ramdisk /usr/local/nagios/etc/nagios.cfg
0
The only thing that might be different with regard to disk is the fact that I do not have much space on /usr
So I have created a symbolic link from /usr/local -------> /opt
[nagios@its-nagios-d1 usr]$ pwd
/usr
[nagios@its-nagios-d1 usr]$ ls -l local
lrwxrwxrwx 1 root root 4 Oct 20 2015 local -> /opt
But the permissions are opened to allow...perhaps if coding within the nrdp server might be using relative paths to find certain files/directories I guess that might cause the issue...that would make me cry though. Using relative paths to look for things is not a good way to code IMHO because it introduces possible conflicts such as linking between available filesystems.
I guess I could try modifying the checkresults dir to something like /tmp/checkresults for testing...but that really bothers me.
Re: BAD CHECK RESULTS DIR
May be the permissions on the /opt directory, what are the outputs of these commands?
Thank you
Code: Select all
sestatus
ls -ld /opt
ls -l /optRe: BAD CHECK RESULTS DIR
So I changed the checkresults spool directory to /tmp/checkresults in the /usr/local/nrdp/server/config.inc.php and restarted Apache...afterwards it appears the files are being created now but it doesn't appear that Nagios XI is processing them...where would I specify within Nagios XI to use the same check results directory...
[nagios@its-nagios-d1 checkresults]$ pwd
/tmp/checkresults
[nagios@its-nagios-d1 checkresults]$ ls -l
total 44
-rwxrwx--- 1 apache nagcmd 201 Feb 1 13:51 c3sFqax
-rw-r--r-- 1 apache apache 0 Feb 1 13:51 c3sFqax.ok
So it appears that the symbolic link is wrecking the creation of the files...that appears to be the only explanation.
So where do I configure within Nagios to process those result files?
Let me know and thanks,
Danny
[nagios@its-nagios-d1 checkresults]$ pwd
/tmp/checkresults
[nagios@its-nagios-d1 checkresults]$ ls -l
total 44
-rwxrwx--- 1 apache nagcmd 201 Feb 1 13:51 c3sFqax
-rw-r--r-- 1 apache apache 0 Feb 1 13:51 c3sFqax.ok
So it appears that the symbolic link is wrecking the creation of the files...that appears to be the only explanation.
So where do I configure within Nagios to process those result files?
Let me know and thanks,
Danny
Re: BAD CHECK RESULTS DIR
It's likely just the permissions on /opt that is causing the issue.
If you do actually want to change it to a different location you would need to edit:
File:
Change:
File:
Change:
Then restart the services:
If you do actually want to change it to a different location you would need to edit:
File:
Code: Select all
/usr/local/nagios/etc/nagios.cfgCode: Select all
check_result_path=/var/nagiosramdisk/spool/checkresultsCode: Select all
/usr/local/nrdp/server/config.inc.phpCode: Select all
$cfg["check_results_dir"]="/var/nagiosramdisk/spool/checkresults";Code: Select all
service nagios restart
service httpd restart
service npcd restartRe: BAD CHECK RESULTS DIR
I don't think its /opt permissions...I can move around UN-hindered from anywhere in the nagios or nrdp directories back down through the tree and back up...
I can also touch a file on that full path...
[nagios@its-nagios-d1 nagios]$ cd /
[nagios@its-nagios-d1 /]$ touch /usr/local/nagios/var/spool/checkresults/myTest
[nagios@its-nagios-d1 /]$ ls -l /usr/local/nagios/var/spool/checkresults/myTest
-rw-rw-r-- 1 nagios nagcmd 0 Feb 1 14:29 /usr/local/nagios/var/spool/checkresults/myTest
So I find it hard to believe /opt is the problem but I have seen weird things in the past but mostly on Solaris with regard to links and mounts...
[nagios@its-nagios-d1 checkresults]$ sestatus
SELinux status: disabled
[nagios@its-nagios-d1 checkresults]$ ls -ld /opt
drwxr-xr-x. 23 root root 4096 Feb 1 12:46 /opt
[nagios@its-nagios-d1 checkresults]$ ls -l /opt
total 96
drwxr-xr-x 2 root root 4096 Oct 26 06:40 bin
drwxr-xr-x 2 root root 4096 Jun 28 2011 etc
drwxr-xr-x 2 root root 4096 Jun 28 2011 games
drwxr-xr-x 4 root root 4096 Oct 20 2015 ibm
drwxr-xr-x 2 root root 4096 Jun 28 2011 include
drwxr-xr-x 4 root root 4096 Dec 1 2011 lib
drwxr-xr-x 3 root root 4096 Nov 10 2015 lib64
drwxr-xr-x 2 root root 4096 Jun 28 2011 libexec
drwx------. 2 root root 16384 Oct 20 2015 lost+found
drwxr-xr-x 9 nagios nagios 4096 Nov 3 2015 nagios
drwxr-xr-x 6 root root 4096 Nov 3 2015 nagiosmobile
drwxr-xr-x 10 nagios nagios 4096 Nov 3 2015 nagiosxi
drwxr-xr-x 5 apache apache 4096 Nov 3 2015 nagvis
drwxrwxr-x 7 nagios nagios 4096 Jan 23 07:49 ncpa
drwxr-xr-x 7 nagios nagios 4096 Jan 4 10:38 nrdp
drwxr-xr-x 4 root root 4096 Oct 25 13:47 nsis
drwxr-xr-x 2 root root 4096 Jun 28 2011 sbin
drwxr-xr-x 6 root root 4096 Nov 10 2015 share
drwxr-xr-x 2 root root 4096 Jan 4 11:42 src
drwxr-xr-x. 3 root root 4096 Oct 20 2015 tivoli
Just too darn weird...
I will try some other things and try and pin point exactly what is happening here is possible...I think if I could put the portion that writes the files to the checkresults directory it might give us a better clue as to where the breakdown is occurring????
Danny
I can also touch a file on that full path...
[nagios@its-nagios-d1 nagios]$ cd /
[nagios@its-nagios-d1 /]$ touch /usr/local/nagios/var/spool/checkresults/myTest
[nagios@its-nagios-d1 /]$ ls -l /usr/local/nagios/var/spool/checkresults/myTest
-rw-rw-r-- 1 nagios nagcmd 0 Feb 1 14:29 /usr/local/nagios/var/spool/checkresults/myTest
So I find it hard to believe /opt is the problem but I have seen weird things in the past but mostly on Solaris with regard to links and mounts...
[nagios@its-nagios-d1 checkresults]$ sestatus
SELinux status: disabled
[nagios@its-nagios-d1 checkresults]$ ls -ld /opt
drwxr-xr-x. 23 root root 4096 Feb 1 12:46 /opt
[nagios@its-nagios-d1 checkresults]$ ls -l /opt
total 96
drwxr-xr-x 2 root root 4096 Oct 26 06:40 bin
drwxr-xr-x 2 root root 4096 Jun 28 2011 etc
drwxr-xr-x 2 root root 4096 Jun 28 2011 games
drwxr-xr-x 4 root root 4096 Oct 20 2015 ibm
drwxr-xr-x 2 root root 4096 Jun 28 2011 include
drwxr-xr-x 4 root root 4096 Dec 1 2011 lib
drwxr-xr-x 3 root root 4096 Nov 10 2015 lib64
drwxr-xr-x 2 root root 4096 Jun 28 2011 libexec
drwx------. 2 root root 16384 Oct 20 2015 lost+found
drwxr-xr-x 9 nagios nagios 4096 Nov 3 2015 nagios
drwxr-xr-x 6 root root 4096 Nov 3 2015 nagiosmobile
drwxr-xr-x 10 nagios nagios 4096 Nov 3 2015 nagiosxi
drwxr-xr-x 5 apache apache 4096 Nov 3 2015 nagvis
drwxrwxr-x 7 nagios nagios 4096 Jan 23 07:49 ncpa
drwxr-xr-x 7 nagios nagios 4096 Jan 4 10:38 nrdp
drwxr-xr-x 4 root root 4096 Oct 25 13:47 nsis
drwxr-xr-x 2 root root 4096 Jun 28 2011 sbin
drwxr-xr-x 6 root root 4096 Nov 10 2015 share
drwxr-xr-x 2 root root 4096 Jan 4 11:42 src
drwxr-xr-x. 3 root root 4096 Oct 20 2015 tivoli
Just too darn weird...
I will try some other things and try and pin point exactly what is happening here is possible...I think if I could put the portion that writes the files to the checkresults directory it might give us a better clue as to where the breakdown is occurring????
Danny
Re: BAD CHECK RESULTS DIR
It's likely running as apache and not nagios, please try running this command:
You may need to restart apache:
Code: Select all
chmod 775 /optCode: Select all
service httpd restart