RamDisk Question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
awang
Posts: 25
Joined: Wed Jun 17, 2015 12:32 pm

RamDisk Question

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: RamDisk Question

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
awang
Posts: 25
Joined: Wed Jun 17, 2015 12:32 pm

Re: RamDisk Question

Post 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 ~]$
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: RamDisk Question

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
awang
Posts: 25
Joined: Wed Jun 17, 2015 12:32 pm

Re: RamDisk Question

Post 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'
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: RamDisk Question

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
awang
Posts: 25
Joined: Wed Jun 17, 2015 12:32 pm

Re: RamDisk Question

Post 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]$
awang
Posts: 25
Joined: Wed Jun 17, 2015 12:32 pm

Re: RamDisk Question

Post by awang »

and the perfdata/ is still growing. still no file is removed by NPCD process
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: RamDisk Question

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
awang
Posts: 25
Joined: Wed Jun 17, 2015 12:32 pm

Re: RamDisk Question

Post by awang »

Thanks, email ticket is perfect.
attached the config files below.
You do not have the required permissions to view the files attached to this post.
Locked