Page 1 of 2
RAMDISK Config lost after NagiosXI upgrade
Posted: Tue Mar 10, 2015 7:58 pm
by Fred Kroeger
Just upgraded NagiosXi to the latest and all my RAMDISK settings in /etc/init.d/nagios have been wiped - *again*.
I only found out the hard way after I rebooted the Nagios server and discovered that Nagios wasn't working!
I can see that a section has been added to the init.d file to automate the addition of the RAMDISK using environment variables, however I can't find any reference in the knowledgebase as to what they are, where to define them or what they should look like.
The Utilising a RAMDISK in NagiosXI still specifies that you update the init.d file - nothing at all about these environment variables. This needs to be updated.
Can you point me to the relevant doco please?
Regards... Fred
Re: RAMDISK Config lost after NagiosXI upgrade
Posted: Wed Mar 11, 2015 9:13 am
by cmerchant
I don't believe the current document has you change the init proc. The document you want to reference is:
http://assets.nagios.com/downloads/nagi ... giosXI.pdf
Re: RAMDISK Config lost after NagiosXI upgrade
Posted: Wed Mar 11, 2015 11:02 pm
by Box293
cmerchant,
What Fred is stating is that he's previously followed this document.
However when Nagios XI gets upgraded, the /etc/init.d/nagios file is being replaced.
So now Fred has to go and change the /etc/init.d/nagios file back to what it was before the upgrade (following the document).
However Fred has noticed that there is now a RAMDISK section in the /etc/init.d/nagios file which has previously not existed. I looked at some test systems I have here and it seems to have not existed on a 2014R2.0 system however on a 2014R2.4 system there is the RAMDISK section:
Code: Select all
# Automate addition of RAMDISK based on environment variables
USE_RAMDISK=${USE_RAMDISK:-0}
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
It appears that this has not been documented yet and is not mentioned in the release notes.
So Fred is asking for the correct method moving forward. The next time he updates Nagios XI he doesn't want to lose his settings all over again.
Fred,
Please correct me if anything I said here is not what you mean.
Re: RAMDISK Config lost after NagiosXI upgrade
Posted: Thu Mar 12, 2015 1:18 am
by Fred Kroeger
Spot On Troy!
and if cmerchant actually reads the document quoted you will see that under the Making RAM DIsk Permanent section you are instructed to:
Code: Select all
Update the Nagios init script so that the required directories exist.
Add the following lines to the top of/etc/init.d/nagios just under the comments
Fred
Re: RAMDISK Config lost after NagiosXI upgrade
Posted: Thu Mar 12, 2015 11:00 am
by cmerchant
Must confess, I didn't take time to read the doc. I verified that indeed, the upgrade script copies over a newer version of the nagios init script if you were upgrading from a certain version (2.x). I spoke with the Dev's and they have made a change for future upgrades of XI will create a backup version of the init script first before copying over a newer version.
Re: RAMDISK Config lost after NagiosXI upgrade
Posted: Thu Mar 12, 2015 7:48 pm
by Fred Kroeger
Thanks - however I would prefer to move forward and implement the "secret RAMDISK configs" if that is the new way of doing things.
Much better to use the standard init script than having to copy back the backup version each time ( and make any other changes to the init script)!
So.... what are the secret RAMDISK configs required for the new init script?
Fred
Re: RAMDISK Config lost after NagiosXI upgrade
Posted: Fri Mar 13, 2015 10:16 am
by cmerchant
Fred, I do not know which files and directories were setup for ramdisk in your previous /etc/init.d/nagios.cfg and /usr/local/nagios/etc/nagios.cfg file. So it would be helpful for you to do the following first:
Code: Select all
grep -E 'retention|object.cache|status.dat|checkresults|temp_path' /usr/local/nagios/etc/nagios.cfg | grep -i ram
Re: RAMDISK Config lost after NagiosXI upgrade
Posted: Fri Mar 13, 2015 10:28 am
by BanditBBS
Interesting. I upgraded from 2.0 to 2.6 just last week and I verified my nagios init was not updated, it is still properly modified for using ramdisk. I wonder why mine wasn't updated.
Re: RAMDISK Config lost after NagiosXI upgrade
Posted: Fri Mar 13, 2015 10:48 am
by cmerchant
Banditt, Don't feel left out.... The upgrade script clobbered the /etc/init.d/nagios only if you were upgrading from 2.2 or 2.3. (don't ask, Scott has already fixed this, along with creating a backup in the next release).
you can look at the upgraded script in the install directory:
Code: Select all
/tmp/nagiosxi/subcomponents/nagioscore/mods/nagios.init
Re: RAMDISK Config lost after NagiosXI upgrade
Posted: Sun Mar 15, 2015 9:57 pm
by Fred Kroeger
Here you go - but what I was actually asking is what are the RAMDISK variables & where should they be defined so it works with the new init.d file?
Code: Select all
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