Need to perform an offline install with certain requirements

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Need to perform an offline install with certain requirements

Post by jolson »

Hello everyone, I am new to this forum and have a strict set of requirements in addition to a specific set of skills. The requirements are as follows:

* Nagios XI must be installed entirely offline
* The MySQL database should exist in /usr/local/nagios/mysql (ideally)

My skills are as follows:

* I have performed an offline installation of Nagios XI in my past - I should have no problem following the documentation.
* I have never moved the MySQL database to a non-standard store location. Obviously it's very straightforward, but I do not know if this will cause future problems regarding my Nagios XI installation. I would like to make this installation as stable as possible - if that means moving the database back to /var/lib I will do so per your recommendation.

My question boils down to: If I move the MySQL database to a non-standard location, is there a risk of that procedure breaking Nagios XI functionality/future upgrades? Please kindly do the needful! :ugeek:

Jesse
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Need to perform an offline install with certain requirem

Post by tmcdonald »

Hello @jolson, and welcome to the forums (for the first time ever I'm sure)!

Online vs offline should not matter as far as the database is concerned, and as long as the database is on your localhost there should not be too many issues. The backup and restore scripts (located under /usr/local/nagiosxi/scripts/ named backup_xi.sh and restore_xi.sh respectively) were updated fairly recently to work directly through port 3306 (via a call to mysqldump) as opposed to grabbing the MYI and MYD files directly, so that actually will work no matter where the database files are (local or remote). However, the repair_databases.sh script (also located in /usr/local/nagiosxi/scripts/) does still iterate over the MYI files via the repairmysql.sh file as seen here:

Code: Select all

--- SNIP ---
echo "DATABASE: $db"
echo "TABLE:    $table"

cmd="/usr/bin/myisamchk -r -f"

if [ "x$table" == "x" ]; then
        t="*.MYI"
else
        t=$table;
fi

dest="/var/lib/mysql/$db"
pushd $dest
ret=$?
if [ $ret -eq 0 ]; then
        $BASEDIR/manage_services.sh stop mysqld
        $cmd $t --sort_buffer_size=256M
        $BASEDIR/manage_services.sh start mysqld
        popd
else
        echo "ERROR: Could not change to dir: $dest"
        exit 1
fi
--- SNIP ---
So you will likely need to either modify the script to point from /var/lib/mysql/ to /usr/local/nagios/mysql/ (which will be overwritten on an update) or make a symlink to the correct directory.

This is the only script that I know will need to be changed, however there could be others so I would advise you to try this in a test environment first for a few days before moving to production. I'll also point out that we haven't tested this internally, so I cannot guarantee 100% functionality if these files are moved.

Let us know if you have any further questions, or if you run into any issues.
Former Nagios employee
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Need to perform an offline install with certain requirem

Post by jolson »

I appreciate the ASAP response. The symlink solution (TSS) is the one that I will proceed with. This will stand for a few days in dev before being replicated in prod - the installation procedure will begin today.

Any issues that crop up (and I'm sure that there will be none) will be hastily resolved or reported as appropriate.

Thank you @tmcdonald, you are a saint and I wish you glory. You may mark this case closed.


Jesse
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
ischwartz

Re: Need to perform an offline install with certain requirem

Post by ischwartz »

I will close this now, thanks!
Locked