Page 1 of 2

RamDisk Question

Posted: Tue Jan 12, 2016 3:54 pm
by awang
Hi ,

I have applied Ramdisk to the NagiosXI server (https://assets.nagios.com/downloads/nag ... giosXI.pdf). And I do see there are some files have been produces under /var/nagiosramdisk/spool/perfdata directory.

Will these files stay under the perfdata directory only temporally? if Yes, for how long? if no, do we need to manually clean up this perfdata periodically?

Thanks

Re: RamDisk Question

Posted: Tue Jan 12, 2016 5:39 pm
by lmiltchev
Did you use the "automatic" RAM disk installation (our script) or you set it up manually?

The files in the "/usr/local/nagios/var/spool/perfdata" directory should be processed by the npcd. If they are not getting removed from the "perfdata" directory, this may indicate that npcd is NOT running.

Can you show us the output of the following commands?

Code: Select all

uptime
service npcd status
ls /var/nagiosramdisk/spool/xidpe | wc -l
ls /var/nagiosramdisk/spool/perfdata/ | wc -l
ls /var/nagiosramdisk/spool/checkresults/ | wc -l

Re: RamDisk Question

Posted: Wed Jan 13, 2016 10:21 am
by awang
Yes, I used automatic installation.

Code: Select all

[awang@lltcnagios-sed02 ~]$ uptime
 09:17:42 up 246 days,  1:06,  2 users,  load average: 2.29, 2.08, 2.08
[awang@lltcnagios-sed02 ~]$ service npcd status
NPCD running (pid 2573).
[awang@lltcnagios-sed02 ~]$ ls /var/nagiosramdisk/spool/xidpe | wc -l
0
[awang@lltcnagios-sed02 ~]$ ls /var/nagiosramdisk/spool/perfdata/ | wc -l
57680
[awang@lltcnagios-sed02 ~]$ ls /var/nagiosramdisk/spool/checkresults/ | wc -l
0
[awang@lltcnagios-sed02 ~]$

Re: RamDisk Question

Posted: Wed Jan 13, 2016 11:43 am
by tgriep
The buildup of files in the following folder

Code: Select all

/var/nagiosramdisk/spool/perfdata/
Should not happen.
The npcd process will delete those files after it is finished with them.
I would go through the RAM disk document and verify that the settings are correct especially for these 2 files.

Code: Select all

/usr/local/nagios/etc/pnp/npcd.cfg
/usr/local/nagiosxi/html/config.inc.php
If you do change the setting in those files, you will have to restart the following processes by running this as root on the Nagios server.

Code: Select all

service nagios restart
service httpd restart
service npcd restart

Re: RamDisk Question

Posted: Wed Jan 13, 2016 1:12 pm
by awang
well, Npcd.cfg seems fine. I copied the output from npcd.log, any idea?

Code: Select all

[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624185.perfdata.service'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624215.perfdata.host'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624215.perfdata.service'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624245.perfdata.host'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624230.perfdata.service'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624230.perfdata.host'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624260.perfdata.service'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624261.perfdata.host'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624275.perfdata.service'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624245.perfdata.service'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624276.perfdata.host'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624290.perfdata.service'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624291.perfdata.host'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624305.perfdata.service'
[01-13-2016 12:09:47] NPCD: ERROR: Command line was '/usr/local/nagios/libexec/process_perfdata.pl -n -b /var/nagiosramdisk/spool/perfdata//1452624320.perfdata.host'
[01-13-2016 12:09:47] NPCD: ERROR: Executed command exits with return code '2'

Re: RamDisk Question

Posted: Wed Jan 13, 2016 2:45 pm
by lmiltchev
Try removing the perfdata directory and recreating it:

Code: Select all

cd /var/nagiosramdisk/spool/
rm -rf perfdata
mkdir perfdata
chown nagios.nagios perfdata
chmod 755 perfdata
service npcd restart
Next, run the following command and watch the number of files in the "perfdata" directory to see if it is increasing:

Code: Select all

watch -n 1 'ls /var/nagiosramdisk/spool/perfdata/ | wc -l'
Let's check some of the permissions as well - run the following commands and show the output:

Code: Select all

ll /usr/local/nagios/libexec/process_perfdata.pl
ll /var/nagiosramdisk
ll /var/nagiosramdisk/spool

Re: RamDisk Question

Posted: Wed Jan 13, 2016 3:05 pm
by awang
here is the check permission output

Code: Select all

[awang@lltcnagios-sed02 spool]$ ll /usr/local/nagios/libexec/process_perfdata.pl
-rwsr-xr-x 1 root root 42802 Jun  5  2015 /usr/local/nagios/libexec/process_perfdata.pl
[awang@lltcnagios-sed02 spool]$ ll /var/nagiosramdisk
total 1536
drwxr-xr-x 2 nagios nagios      40 Jan  8 09:01 checkresults
-rw-r--r-- 1 nagios nagios       0 Jan 13 14:03 host-perfdata
-rw-r--r-- 1 nagios nagios  535578 Jan 13 11:56 objects.cache
-rw-r--r-- 1 nagios nagios     842 Jan 13 14:04 service-perfdata
drwxrwxr-x 5 nagios nagios     100 Jan 13 14:00 spool
-rw-r--r-- 1 nagios nagios 1028404 Jan 13 14:04 status.dat
drwxrwxr-x 2 nagios nagios      40 Jan 13 11:56 tmp
[awang@lltcnagios-sed02 spool]$ ll /var/nagiosramdisk/spool
total 0
drwxrwxr-x 2 nagios nagios  40 Jan 13 11:56 checkresults
drwxrwxr-x 2 nagios nagios 720 Jan 13 14:04 perfdata
drwxrwxr-x 2 nagios nagios  40 Jan 13 14:04 xidpe
[awang@lltcnagios-sed02 spool]$

Re: RamDisk Question

Posted: Wed Jan 13, 2016 5:02 pm
by awang
and the perfdata/ is still growing. still no file is removed by NPCD process

Re: RamDisk Question

Posted: Wed Jan 13, 2016 6:36 pm
by lmiltchev
Can you post the following files - "/usr/local/nagios/etc/nagios.cfg", "usr/local/nagiosxi/html/config.inc.php", and "/usr/local/nagios/etc/pnp/npcd.cfg"? (hide sensitive info)

Is opening an email ticket an option for you? We may need to schedule a remote session to further troubleshoot this issue.

Re: RamDisk Question

Posted: Thu Jan 14, 2016 10:17 am
by awang
Thanks, email ticket is perfect.
attached the config files below.