how do I uninstall a ramdisk?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

how do I uninstall a ramdisk?

Post by benhank »

I used the nagios script to install a ramdisk on my servers, but the ramdisk is full causing havoc with my systems. How do I remove it and restore the files the system backed up prior to the ramdisk install?
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: how do I uninstall a ramdisk?

Post by tgriep »

Below is the link for installing a ramdisk manual, in it is are files the script modifies when installing it so you would have to go through the files and put back the settings to remove the ramdisk settings.
https://assets.nagios.com/downloads/nag ... giosXI.pdf
Try that and post any questions that you may have.
Be sure to check out our Knowledgebase for helpful articles and solutions!
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: how do I uninstall a ramdisk?

Post by gormank »

I have 6 XI systems and have never had a ramdisk get full. The OP may want to wonder why its getting full rather than removing it. I'd guess perfdata is not getting removed and removing the ramdisk just transfers the problem to a physical drive. That will mean bigger problems later.

# df
# cd /var/nagiosramdisk
# du -sk ./*
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: how do I uninstall a ramdisk?

Post by benhank »

gormank wrote:I have 6 XI systems and have never had a ramdisk get full. The OP may want to wonder why its getting full rather than removing it. I'd guess perfdata is not getting removed and removing the ramdisk just transfers the problem to a physical drive. That will mean bigger problems later.

# df
# cd /var/nagiosramdisk
# du -sk ./*
I like how you think man, ill give it a shot
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: how do I uninstall a ramdisk?

Post by benhank »

as I expected,it's my perfdata, which is much larger than the 1.5 gigs I allocated to it
my perfdata under normal circumstances is about 40 ish gigs, thats why I want to remove the ramdisk
here you go:

Code: Select all

# df
Filesystem           1K-blocks     Used Available Use% Mounted on
/dev/mapper/vg_lkensherlockp-lv_root
                      60475476 17834376  39569100  32% /
tmpfs                 12286672       12  12286660   1% /dev/shm
/dev/sda1               495844    70931    399313  16% /boot
/dev/mapper/vg_lkensherlockp-lv_home
                      67946064  3229732  61264840   6% /home
isilon.healthone.org:/ifs/data/monitoring/sherlock
                     314572800 42242048 272330752  14% /scratch
tmpfs                  1536000  1536000         0 100% /var/nagiosramdisk
[root@lkensherlockp01 ~]# cd /var/nagiosramdisk
[root@lkensherlockp01 nagiosramdisk]# du -sk ./*
0       ./checkresults
121132  ./host-perfdata
13716   ./objects.cache
1401152 ./service-perfdata
0       ./spool
0       ./tmp
[root@lkensherlockp01 nagiosramdisk]#

Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: how do I uninstall a ramdisk?

Post by gormank »

Can you look in the perfdata dirs to see the timestamps on the files?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: how do I uninstall a ramdisk?

Post by lmiltchev »

Can you run the following commands, and show the output?

Code: Select all

ls /var/nagiosramdisk/spool/xidpe | wc -l
ls /var/nagiosramdisk/spool/perfdata/ | wc -l
ls /var/nagiosramdisk/spool/checkresults/ | wc -l
grep RAMDISK_SIZE /etc/sysconfig/nagios
uptime
service npcd status
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: how do I uninstall a ramdisk?

Post by benhank »

Code: Select all

kp01 ~]# ls /var/nagiosramdisk/spool/xidpe | wc -l
0
[root@lkensherlockp01 ~]# ls /var/nagiosramdisk/spool/perfdata/ | wc -l
0
[root@lkensherlockp01 ~]# ls /var/nagiosramdisk/spool/checkresults/ | wc -l
0
[root@lkensherlockp01 ~]# grep RAMDISK_SIZE /etc/sysconfig/nagios
RAMDISK_SIZE=1500
   mount -t tmpfs -o size=${RAMDISK_SIZE}m tmpfs ${RAMDISK_DIR}
[root@lkensherlockp01 ~]# uptime
 11:18:21 up 75 days, 15 min,  1 user,  load average: 0.00, 0.00, 0.00
[root@lkensherlockp01 ~]# service npcd status
# service npcd status
npcd (pid 2607) is running...
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: how do I uninstall a ramdisk?

Post by tgriep »

Something stopped the /var/nagiosramdisk/service-perfdata file from being processed in the past causing it to grow to large causing it to stop.
If you delete that file, that should start it running again.
Also, can you run the following command and post the output?

Code: Select all

grep service-per /usr/local/nagios/etc/*
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: how do I uninstall a ramdisk?

Post by benhank »

I'll post it, but here is my problem. the two servers I installed the ramdisk on are what we call "the new environment". We are about to migrate our users from our curent environment which is running xi 2014. I cant afford to have glitches in the new envrionment after we do the migration. For that reason, I just need to uninstall the ramdisk, and do more testing before we implement it again. I read through the script but I cant make sense out of it, as scriptwriting isnt my forte. My setup has a few customisations that we implemented that broke(not your fault, I should have done some basic due diligence prior to the install), that have to be taken into concideration prior to installing the ramdisk.
If you guys could tell me which backed up files need to be restored and the commands to unmount the ramdisk, that should do it for me for now.
here is the output:

Code: Select all

]# grep service-per /usr/local/nagios/etc/*
/usr/local/nagios/etc/commands.cfg:       command_name                                  process-service-perfdata
/usr/local/nagios/etc/commands.cfg:       command_name                                  process-service-perfdata-file
/usr/local/nagios/etc/commands.cfg:       command_line                                  /bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$
/usr/local/nagios/etc/commands.cfg:       command_name                                  process-service-perfdata-file-bulk
/usr/local/nagios/etc/commands.cfg:       command_line                                  /bin/mv /var/nagiosramdisk/service-perfdata /var/nagiosramdisk/spool/xidpe/$TIMET$.perfdata.service
/usr/local/nagios/etc/nagios.cfg:service_perfdata_file=/var/nagiosramdisk/service-perfdata
/usr/local/nagios/etc/nagios.cfg:service_perfdata_file_processing_command=process-service-perfdata-file
/usr/local/nagios/etc/nagios.cfg~:service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata
/usr/local/nagios/etc/nagios.cfg~:service_perfdata_file_processing_command=process-service-perfdata-file
/usr/local/nagios/etc/newcommnands.cfg:       command_name                              process-service-perfdata
/usr/local/nagios/etc/newcommnands.cfg:       command_name                              process-service-perfdata-file
/usr/local/nagios/etc/newcommnands.cfg:       command_line                              /bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$
/usr/local/nagios/etc/newcommnands.cfg:       command_name                              process-service-perfdata-file-bulk
/usr/local/nagios/etc/newcommnands.cfg:       command_line                              /bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$
/usr/local/nagios/etc/newcommnands.cfg:       command_name                              process-service-perfdata-file-pnp-bulk
/usr/local/nagios/etc/newcommnands.cfg:       command_line                              /bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$
/usr/local/nagios/etc/newcommnands.cfg:       command_name                              process-service-perfdata-pnp-normal
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
Locked