Вы находитесь на странице: 1из 2

Nagios XI Backing Up and Restoring

The Industry Standard in IT Infrastructure Monitoring


Purpose
This document describes how to backup a Nagios XI installation and restore an XI installation from a previously made backup. Backups are an important aspect of administration and maintenance, and can easily facilitate the migration of a XI installation between a virtual server and physical server and the design of a failover or disaster recovery instance of XI.

Target Audience
This document is intended for use by Nagios XI Administrators.

Version Requirements
The steps described in this documentation require that your Nagios XI installation be running 2009R1.2C or later. Previous versions of Nagios XI do not include the backup and restore scripts described in this document.

Creating A Backup
You can create a backup of your Nagios XI installation by running the following script as the root user: /usr/local/nagiosxi/scripts/backup_xi.sh Note: If you changed your MySQL root password to something different than nagiosxi (the default), 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 NagiosXI:

Nagios Core files (/usr/local/nagios) Nagios XI files (/usr/local/nagiosxi) NagiosQL files (/var/www/html/nagiosql and /etc/nagiosql) Select Apache config files (in /etc/httpd/conf.d) Select logrotate config files (in /etc/logrotate.d) Select MySQL databases (nagios and nagiosql) Select PostgresQL databases (nagiosxi)

The backup script will save backups in the /store/backups/nagiosxi directory. Backups names correspond to the Unix timestamp at the time the backups were created.

Archiving Backups
It is recommended that you save a copy of the backups that are created on an another server or backup medium. Although 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.

Nagios Enterprises, LLC P.O. Box 8154 Saint Paul, MN 55108 USA

US: 1-888-NAGIOS-1 Int'l: +1 651-204-9102 Fax: +1 651-204-9103

Web: www.nagios.com Email: sales@nagios.com

Page 1
Copyright 2011 Nagios Enterprises, LLC Revision 1.0 March, 2012

Nagios XI Backing Up and Restoring


Restoring From 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 required users, groups, and packages are setup and installed on the target system. You can restore a backup of your Nagios XI installation by running the following script as the root user: /usr/local/nagiosxi/scripts/restore_xi.sh <backupfile.zip> Example: /usr/local/nagiosxi/scripts/restore_xi.sh /store/backups/nagiosxi/1279411912.zip Note: If you changed your MySQL root password to something different than nagiosxi (the default), 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 (if these components exist, they will be deleted and/or overwritten):

Nagios Core files (/usr/local/nagios) Nagios XI files (/usr/local/nagiosxi) NagiosQL files (/var/www/html/nagiosql and /etc/nagiosql) Select Apache config files (in /etc/httpd/conf.d) Select logrotate config files (in /etc/logrotate.d) Select MySQL databases (nagios and nagiosql) Select PostgresQL databases (nagiosxi)

Things to Consider
If you are restoring a backup from a different OS version or architecture this can be a problem because the backup is overwriting the compiled binaries. A work around follows: If you still have the /tmp/nagiosxi install directory do the following: cd /tmp/nagiosxi rm -f installed.subcomponents ./A-subcomponents ./build-perms-bin If you have already deleted the /tmp/nagiosxi install directory do the following: cd /tmp wget http://assets.nagios.com/downloads/nagiosxi/xi-2011-latest.tar.gz tar xzf xi-2011-latest.tar.gz cd /tmp/nagiosxi touch installed.mrtg ./A-subcomponents ./build-perms-bin

Nagios Enterprises, LLC P.O. Box 8154 Saint Paul, MN 55108 USA

US: 1-888-NAGIOS-1 Int'l: +1 651-204-9102 Fax: +1 651-204-9103

Web: www.nagios.com Email: sales@nagios.com

Page 2
Copyright 2011 Nagios Enterprises, LLC Revision 1.0 March, 2012

Вам также может понравиться