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
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: how do I uninstall a ramdisk?

Post by tgriep »

The ram disk install script should of backed up the changed files to this folder.

Code: Select all

/usr/local/nagios/ramdiskbackup/
The hard part is that if you edited those files since installing the ramdisk, restoring them could make things worse.
Also, it looks like your settings are customized with pnp4nagios so restoring the settings may be even trickier.
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 »

good news there werent any changes after the ram disk was set up.
so just retoring the backed up files and unmounting the disk will do the trick?
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 »

Yes, that should do it for you.
If possible, make a full backup of the server before restoring those files.
Be sure to check out our Knowledgebase for helpful articles and solutions!
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 »

so just retoring the backed up files and unmounting the disk will do the trick?
You will have to delete the "/etc/sysconfig/nagios"

Code: Select all

rm -f /etc/sysconfig/nagios
and reboot.

Other than that, you need to revert all of the changes you made. Doing this manually would be:

1. Remove the nagiosramdisk directory:

Code: Select all

rm -rf /var/nagiosramdisk
2. Open /usr/local/nagios/etc/nagios.cfg and change the lines below from this:

Code: Select all

service_perfdata_file=/var/nagiosramdisk/service-perfdata
host_perfdata_file=/var/nagiosramdisk/host-perfdata
check_result_path=/var/nagiosramdisk/spool/checkresults
object_cache_file=/var/nagiosramdisk/objects.cache
status_file=/var/nagiosramdisk/status.dat
temp_path=/var/nagiosramdisk/tmp
to this:

Code: Select all

service_perfdata_file=/usr/local/nagios/var/service-perfdata
host_perfdata_file=/usr/local/nagios/var/host-perfdata
check_result_path=/usr/local/nagios/var/spool/checkresults
object_cache_file=/usr/local/nagios/var/objects.cache
status_file=/usr/local/nagios/var/status.dat
temp_path=/tmp
3. Open the "/usr/local/nrdp/server/config.inc.php" and change this:

Code: Select all

$cfg["check_results_dir"]="/var/nagiosramdisk/spool/checkresults";
to this:

Code: Select all

$cfg["check_results_dir"]="/usr/local/nagios/var/spool/checkresults";
4. Open the "/usr/local/nagiosxi/html/config.inc.php" and change this:

Code: Select all

$cfg['xidpe_dir'] = '/var/nagiosramdisk/spool/xidpe/';
$cfg['perfdata_spool'] = '/var/nagiosramdisk/spool/perfdata/';
to this:

Code: Select all

$cfg['xidpe_dir'] = '/usr/local/nagios/var/spool/xidpe/';
$cfg['perfdata_spool'] = '/usr/local/nagios/var/spool/perfdata/';
5. Open the "/usr/local/nagios/etc/pnp/npcd.cfg" and change this:

Code: Select all

perfdata_spool_dir = /var/nagiosramdisk/spool/perfdata/
to this:

Code: Select all

perfdata_spool_dir = /usr/local/nagios/var/spool/perfdata/
6. Open the "/usr/local/nagiosmobile/include.inc.php" and change this:

Code: Select all

STATUS_FILE = "/var/nagiosramdisk/status.dat";
$OBJECTS_FILE = "/var/nagiosramdisk/objects.cache";
to this:

Code: Select all

$STATUS_FILE  = "/usr/local/nagios/var/status.dat";
$OBJECTS_FILE = "/usr/local/nagios/var/objects.cache";
7. Restart services:

Code: Select all

service nagios restart
service httpd restart
service npcd restart
8. Go to the CCM->Commands, type "perfdata-file-bulk" in the search bar, and hit "Enter".

Modify the "process-host-perfdata-file-bulk" command so that it looks like this:

Code: Select all

/bin/mv /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/xidpe/$TIMET$.perfdata.host
Save.

Modify the "process-service-perfdata-file-bulk" command so that it looks like this:

Code: Select all

/bin/mv /usr/local/nagios/var/service-perfdata /usr/local/nagios/var/spool/xidpe/$TIMET$.perfdata.service
Save. Apply Configuration.

You can check if you were able to make all of the necessary changes by running:

Code: Select all

watch -n 1 "ls /usr/local/nagios/var/spool/xidpe | wc -l"
and

Code: Select all

watch -n 1 "ls /usr/local/nagios/var/spool/perfdata | wc -l"
Wait for a few minutes after running each command, and make sure the numbers are changing to 0 once in a while (the perfdata is being processed).

You can exit the command by pressing Ctrl+c.

Let us know if this helped.
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 »

Worked like a charm! thanks Ludmil!
BTW, the ramdisk script and the ramdisk disk itself was awesome! I just forgot that we'd made some modifications that need to be taken into account befor we use a ramdisk again. you guys can lock it up.
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
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: how do I uninstall a ramdisk?

Post by dwhitfield »

Glad to hear it is resolved. I am going to lock the thread. Please feel free to post again if you have you another issue. Thank you for using the Nagios forums!
Locked