Re: RAMDISK Config lost after NagiosXI upgrade
Posted: Mon Mar 16, 2015 11:02 am
Fred, sorry I didn't want to give an answer without checking to see if the new init script would have all of the parameters that your old config needed.
The ramdisk code in the new init script does not have all of the directories created that you have defined. I would still add that code back into your script.
I have found nothing in any document that describes this secret incantation, and hopefully in the next release of Nagios there will be updated documentation as well as streamlining the ramdisk/ tmpfs process. You still need to have the nagios.cfg file to match the ramdisk directories in order to utilize the ramdisk.
I would recommend to anyone who has modified the nagios init script /etc/init.d/nagios, to make a backup copy of the script before proceeding:
Copy over the nagios.init script from the install directory into /etc/init.d/nagios (overwriting the nagios init script)
Edit the new nagios init script: (to add the your old ramdisk dir's back)
to:
I edited the /etc/sysconfig/nagios file (created one, if it didn't exist before)
and I added the following lines:
saved the file and then restarted nagios
The ramdisk code in the new init script does not have all of the directories created that you have defined. I would still add that code back into your script.
I have found nothing in any document that describes this secret incantation, and hopefully in the next release of Nagios there will be updated documentation as well as streamlining the ramdisk/ tmpfs process. You still need to have the nagios.cfg file to match the ramdisk directories in order to utilize the ramdisk.
I would recommend to anyone who has modified the nagios init script /etc/init.d/nagios, to make a backup copy of the script before proceeding:
Code: Select all
cp /etc/init.d/nagios /etc/nagios.init.origCode: Select all
cp -r /tmp/nagiosxi/subcomponents/nagioscore/mods/nagios.init /etc/init.d/nagiosCode: Select all
vi /etc/init.d/nagiosCode: Select all
change the following:
if test "$USE_RAMDISK" -ne 0 && test "$RAMDISK_SIZE"X != "X"; then
ramdisk=`mount |grep "${RAMDISK_DIR} type tmpfs"`
if [ "$ramdisk"X == "X" ]; then
mkdir -p -m 0755 ${RAMDISK_DIR}
mount -t tmpfs -o size=${RAMDISK_SIZE}m tmpfs ${RAMDISK_DIR}
mkdir -p -m 0755 ${RAMDISK_DIR}/checkresults
chown -R $NagiosUser:$NagiosGroup ${RAMDISK_DIR}
fi
fi
Code: Select all
if test "$USE_RAMDISK" -ne 0 && test "$RAMDISK_SIZE"X != "X"; then
ramdisk=`mount |grep "${RAMDISK_DIR} type tmpfs"`
if [ "$ramdisk"X == "X" ]; then
mkdir -p -m 0755 ${RAMDISK_DIR}
mount -t tmpfs -o size=${RAMDISK_SIZE}m tmpfs ${RAMDISK_DIR}
mkdir -p -m 775 /var/nagiosramdisk
mkdir -p -m 775 ${RAMDISK_DIR}/tmp
mkdir -p -m 775 ${RAMDISK_DIR}/spool
mkdir -p -m 775 ${RAMDISK_DIR}/spool/checkresults
chown -R $NagiosUser:$NagiosGroup ${RAMDISK_DIR}
fi
fiCode: Select all
vi /etc/sysconfig/nagiosCode: Select all
export USE_RAMDISK=1
export RAMDISK_DIR=/var/nagiosramdisk
export RAMDISK_SIZE=50Code: Select all
service nagios restart