RAMDISK Config lost after NagiosXI upgrade

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

RAMDISK Config lost after NagiosXI upgrade

Post 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
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: RAMDISK Config lost after NagiosXI upgrade

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: RAMDISK Config lost after NagiosXI upgrade

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: RAMDISK Config lost after NagiosXI upgrade

Post 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
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: RAMDISK Config lost after NagiosXI upgrade

Post 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.
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: RAMDISK Config lost after NagiosXI upgrade

Post 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
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: RAMDISK Config lost after NagiosXI upgrade

Post 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
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: RAMDISK Config lost after NagiosXI upgrade

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: RAMDISK Config lost after NagiosXI upgrade

Post 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
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Re: RAMDISK Config lost after NagiosXI upgrade

Post 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
Locked