You are on page 1of 2

The Industry Standard in IT Infrastructure Monitoring

Purpose
This document describes how to backup a Nagios XI installation and restore a Nagios XI installation from a previously made backup.
Backups are an important aspect of administration and maintenance of your system. They can easily facilitate the migration of a
Nagios XI installation between a virtual server and physical server, and the design of a fail-over or disaster recovery instance of Nagios
XI.
Target Audience
This document is intended for use by Nagios XI dministrators who want to use backups as part of managing a Nagios XI system.
Version Requirements
The steps described in this documentation re!uire that your Nagios XI installation be running "##$%&."' or later. (revious versions of
Nagios XI do not include the backup and restore scripts described in this document.
Creating A Backup
The first step to creating a backup of your Nagios XI system is to open a terminal and log into your Nagios XI server as the root user.
Ne)t you can create a backup of your Nagios XI installation by running the following script*
/usr/local/nagiosxi/scripts/backup_xi.sh
Note If you changed your +y,-. root password to something different than /nagios)i0 1the default2, you will need to edit the script and
change the mysqlpass= definition found in the first few lines of the script.
The backup script will save a copy of the following components of Nagios XI*
Nagios 'ore files 1/usr/local/nagios2
Nagios XI files 1/usr/local/nagiosxi2
Nagios-. files 1/var/www/html/nagiosql and /etc/nagiosql2
,elect pache config files 1in /etc/httpd/conf.d2
,elect logrotate config files 1in /etc/logrotate.d2
,elect +y,-. databases 1nagios and nagiosql2
,elect (ostgres-. databases 1nagiosxi2
The backup script will save backups in the /store/backups/nagiosxi directory. Backups names correspond to the 3ni) timestamp at the
time the backups were created.
Archi!ing Backups
It is recommended that you save a copy of the backups that are created on an another server or backup medium. lthough out of the
scope of this document, we recommend using rsync to replicate the /store/backups directory of the Nagios XI server to another
machine.
Page "
'opyright 4 "#&& - "#&5 Nagios 6nterprises, ..'
%evision &.# 7 pril, "#&5
Nagios #I $ Backing %p And Restoring &our
Nagios #I System
Nagios 'nterprises( ))C %S "*+++*NA,I-S*" .e/ 0001nagios1com
P1-1 Bo2 +"34
Saint Pau5( MN 33"6+
%SA
Int75 8" 93"*:64*;"6: 'mai5sa5es<nagios1com
=a2 8" 93"*:64*;"6>
Restoring =rom A Backup
Before you restore from a backup, you must make sure that you have performed an installation of Nagios XI on the target machine you
plan on restoring. This ensures that re!uired users, groups, and packages are setup and installed on the target system.
8ou can restore a backup of your Nagios XI installation by opening a terminal and running the following script as the root user*
/usr/local/nagiosxi/scripts/restore_xi.sh <backupfile.tar.gz>
6)ample*
/usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/1279411912.tar.gz
Note If you changed your +y,-. root password to something different than /nagios)i0 1the default2, you will need to edit the script and
change the mysqlpass= definition found in the first few lines of the script.
The restore script will restore the following components of NagiosXI 1if these components e)ist, they will be deleted and9or overwritten2*
Nagios 'ore files 1/usr/local/nagios2
Nagios XI files 1/usr/local/nagiosxi2
Nagios-. files 1/var/www/html/nagiosql and /etc/nagiosql2
,elect pache config files 1in /etc/httpd/conf.d2
,elect logrotate config files 1in /etc/logrotate.d2
,elect +y,-. databases 1nagios and nagiosql2,elect (ostgres-. databases 1nagiosxi2
Things to Consider
If you are restoring a backup from a different :, version or architecture this can be a problem because the backup is overwriting the
compiled binaries. work around follows*
If you still have the 9tmp9nagios)i install directory do the following*
cd /tp/nagiosxi
r !f installed.subcoponents
./"!subcoponents
./build!pers!bin
If you have already deleted the 9tmp9nagios)i install directory do the following*
cd /tp
#get http$//assets.nagios.co/do#nloads/nagiosxi/xi!2%11!latest.tar.gz
tar xzf xi!2%11!latest.tar.gz
cd /tp/nagiosxi
touch installed.rtg
./"!subcoponents
./build!pers!bin
=inishing %p
8ou should now be able to create backups and restore from a e)isting backup. If you have additional support related !uestions please
visit us at the Nagios ,upport ;orums*
http*99support.nagios.com9forum
Page :
'opyright 4 "#&& - "#&5 Nagios 6nterprises, ..'
%evision &.# 7 pril, "#&5
Nagios #I $ Backing %p And Restoring &our
Nagios #I System
Nagios 'nterprises( ))C %S "*+++*NA,I-S*" .e/ 0001nagios1com
P1-1 Bo2 +"34
Saint Pau5( MN 33"6+
%SA
Int75 8" 93"*:64*;"6: 'mai5sa5es<nagios1com
=a2 8" 93"*:64*;"6>

You might also like