Restore of Centreon central server

Restore process is divided in two main steps:

  • Re-install the Centreon platform following the installation documentation. Do not forget to upgade system.
  • Restore Centreon-Engines configuration files and Centreon databases

Configurations file restore

Before databases restore, you have first to restore configuration files:

# cd /var/backup
# tar -xvf YYYY-MM-DD-central.tar.gz
# cd backup/central/etc/centreon
# cp * /etc/centreon/

Databases restore

Once CES server reinstalled (same Centreon version), unzip centreon and centreon_storage databases backup:

# /etc/init.d/centstorage stop
# mysql
mysql> drop database centreon;
mysql> drop database centreon_storage;
mysql> CREATE database centreon;
mysql> CREATE database centreon_storage;
mysql> GRANT ALL ON centreon.* TO 'centreon'@'adresseipserveurcentreon' IDENTIFIED BY 'password' ;
mysql> GRANT ALL ON centreon_storage.* TO 'centreon'@'adresseipserveurcentreon' IDENTIFIED BY 'password' ;
mysql> exit;
# gzip -d YYYY-MM-DD-centreon.sql.gz
# mysql centreon < YYYY-MM-DD-centreon.sql
# gzip -d YYYY-MM-DD-centreon_storage.sql.gz
# mysql centreon_storage < YYYY-MM-DD-centreon_storage.sql

Note

Password is stored in configuration files previously restored. For example $mysql_passwd field in file “/etc/centreon/conf.pm”.

Chis may take a while due to the size of “centreon_storage” databases.

Note

The default configuration does not define any password for mysql root user. That’s why we can connect to database using only command “mysql”.

SSH keys restore

This step is to restore the SSH key linked to user centreon and centreon-engine within a distributed environment. Restoration must be done manually. We must therefore initially extract this archive into a temporary directory and move the files one by one according to their location:

# cd /var/backup
# tar -xvf YYYY-MM-DD-engine-name.tar.gz
# cd backup/pollers/engine_name/ssh
# mkdir -p /var/spool/centreon/.ssh/
# chmod 700 /var/spool/centreon/.ssh/
# cp -p authorized_keys /var/spool/centreon/.ssh/

Connection test from central to poller:

# su - centreon
# ssh adresse_ip_poller

Answer “Yes” to the ask question. This is abour add poller print on the central server.

Note

You have to do this operations only if you work with a distributed environment.

Plugins restore

Plugins have been backuped in the archive: “YYYY-MM-DD-engine-name.tar.gz.” Restoration must be done manually. We must therefore initially extract this archive into a temporary directory and move the files one by one according to their location.

On each poller, you have to do:

# cd /var/backup
# tar -xvf YYYY-MM-DD-engine-name.tar.gz
# cd backup/pollers/engine_name/plugins
# cp -pRf * /usr/lib/nagios/plugins

Init script restore

Some checkpoints of Oracle or SAP entail modifying the init script scheduler to add environment variables. If you changed the init script of your scheduler, you will have to restore it. Extract the archive into a temporary directory and move the files according to their location:

# cd /var/backup
# tar -xvf YYYY-MM-DD-engine-name.tar.gz
# cd backup/pollers/engine_name/
# cp init_d_nom_moteur_supervision /etc/init.d/my_monitoring_engine

Note

my_monitoring_engine stands for your monitoring engine name. For example ‘centengine’ for Centreon Engine or ‘nagios’ for Nagios.

Monitoring agent restore

In case you’re using NRPE or NSCA agents, you have to reinstall and then restore configuration:

# cd /var/backup
# tar -xvf YYYY-MM-DD-engine-name.tar.gz
# cd backup/pollers/engine_name/etc
# cp  nrpe.cfg /etc/my_monitoring_engine/
# cp  nsca.cfg /etc/my_monitoring_engine/

Note

You have to do this only if you’re using the monitoring agents.

Note

my_monitoring_engine stands for your monitoring engine name. For example centengine for Centreon Engine or nagios for Nagios.

Generate Centreon-Engine configuration files within centreon

Last step is to generate the Centreon-Engine configuration files within Centreon.

Graphics rebuild

Once your monitoring platform is restored and all is doing well, you can rebuild RRD files in order to restore all performances graphics. To rebuild performance graphics, go to the menu Administration -> Options -> Centstorage -> Manage. On this page, you must select all the services and click “Rebuild RRD Database”.

Installation of backup packets

To perform instlalatino of backup packets please refer to Backup of a Centreon central server.

Your server is now restored.