Page 1 of 1

ramdisk space

Posted: Wed Mar 30, 2016 5:03 am
by saptech
Ramdisk configuration change. I want to change the ramdisk space from 100M to 300M, what are the steps?

Also, is it possible to cleanup the space in the ramdisk?

Kind regards

Re: ramdisk space

Posted: Wed Mar 30, 2016 10:19 am
by lmiltchev
How did you install RAM disk? Did you follow our documentation?

https://assets.nagios.com/downloads/nag ... giosXI.pdf

Was it "automatic" (via the "install_ramdisk.sh" script) or "manual" install?

If this was an automatic install, you should have the following line in the "/etc/sysconfig/nagios" file:

Code: Select all

RAMDISK_SIZE=100
Change it to:

Code: Select all

RAMDISK_SIZE=300
and reboot.

Re: ramdisk space

Posted: Thu Mar 31, 2016 2:34 am
by saptech
it was done using the script. I cannot reboot the machine. I changed the conf file and restarted nagios but the size has not changed. Which steps shall I follow?

Re: ramdisk space

Posted: Thu Mar 31, 2016 9:24 am
by rkennedy
As this is a system wide change, I believe you will need to reboot the machine as a whole.

Re: ramdisk space

Posted: Fri Apr 01, 2016 2:25 am
by saptech
Hi

Open the "/etc/sysconfig/nagios" file in a text editor and add the following lines:
USE_RAMDISK=1
RAMDISK_DIR=/var/nagiosramdisk
RAMDISK_SIZE=100
if [ "`mount |grep "${RAMDISK_DIR} type tmpfs"`"X == "X" ]; then
mount -t tmpfs -o size=${RAMDISK_SIZE}m tmpfs ${RAMDISK_DIR}
fi
mkdir -p -m 775 ${RAMDISK_DIR} ${RAMDISK_DIR}/tmp ${RAMDISK_DIR}/spool
${RAMDISK_DIR}/spool/checkresults ${RAMDISK_DIR}/spool/xidpe ${RAMDISK_DIR}/spool/perfdata
chown -R nagios:nagios ${RAMDISK_DIR}

I believe the change doesn't work because my tmpfs is already mounted

tmpfs 100M 100M 0 100% /var/nagiosramdisk

If I stop nagios, umount tmpfs, resizr to 300M and remount would work? I am not sure if anything else has to be changed

Re: ramdisk space

Posted: Fri Apr 01, 2016 9:30 am
by tgriep
You would have to stop the nagios and npcd processes, then unmount the ramdisk, then start the nagios process which will remount the ramdisk and then start npcd and if should work for you.

Re: ramdisk space

Posted: Tue Apr 05, 2016 2:28 am
by saptech
tmpfs 300M 348K 300M 1% /var/nagiosramdisk


that worked

You can close the ticket