ramdisk space

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
saptech
Posts: 53
Joined: Thu Dec 10, 2015 11:19 am

ramdisk space

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

Re: ramdisk space

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
saptech
Posts: 53
Joined: Thu Dec 10, 2015 11:19 am

Re: ramdisk space

Post 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?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: ramdisk space

Post by rkennedy »

As this is a system wide change, I believe you will need to reboot the machine as a whole.
Former Nagios Employee
saptech
Posts: 53
Joined: Thu Dec 10, 2015 11:19 am

Re: ramdisk space

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

Re: ramdisk space

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
saptech
Posts: 53
Joined: Thu Dec 10, 2015 11:19 am

Re: ramdisk space

Post by saptech »

tmpfs 300M 348K 300M 1% /var/nagiosramdisk


that worked

You can close the ticket
Locked