Pandora: Documentation en: Backup and restore procedures

From Pandora FMS Wiki
Jump to: navigation, search

Go back to Pandora FMS documentation index

1 Backup procedure

1.1 Purpose

The purpose of this document is to illustrate the backup and restore procedures of Pandora FMS appliance.

1.2 Database backup

First, we need to make a backup of the existing database. For this we have two methods to make such backup.

Template warning.png

If you use a history database, you must perform a backup of it as well.

 


1.2.1 Manual backup

mysqldump -u <pandora_db_user> -p <pandora_db_name> | gzip > pandoradb.sql.gz
<enter the password in console>


1.2.2 Pandora FMS Database Backup utility

In the menu extension manager we can find the section of Backup where the following window will appear.


Database_Backup_utility.png

In it we can filter the backups made with that tool by directory and create a new backup of the database:

  • with a description
  • In the directory we want. By default in /var/www/html/pandora_console/attachment/backups

1.3 Configuration files backup

In order to backup Pandora's agents and server configuration files, we type:

tar -pcvzf pandora_configuration.tar.gz /etc/pandora/*.conf

1.4 Agent backup

We also need to backup the agent folder. This is very important to maintain the already deployed collections and the agent plugins.

tar -pcvzf agent.tar.gz /usr/share/pandora_agent

1.5 Server backup

1.5.1 Server plugins

The default folder of the server plugins is under /usr/share/pandora_server (the main Pandora's server folder).

Caution: If you have server plugins placed in other folders, you must backup them as well.

tar -pcvzf pandora_server.tar.gz /usr/share/pandora_server
tar -pcvzf my_plugin_folder.tar.gz /home/myuser/my_plugin_folder

1.5.2 Remote configuration

A backup of the remote configuration files and collections must be performed in order to maintain the remote agent's normal behavior

tar -pcvzf collections.tar.gz /var/spool/pandora/data_in/collections
tar -pcvzf md5.tar.gz /var/spool/pandora/data_in/md5
tar -pcvzf remote_agents_conf.tar.gz /var/spool/pandora/data_in/conf

1.6 Console backup

We now perform a backup of the console, so we mantain our custom images, extensions, and more.

tar -pcvzf pandora_console.tar.gz /var/www/html/pandora_console

2 Restore procedure

2.1 Install the appliance

Insert the CD in your system and press a key in the boot screen. The boot menu will be displayed then. Appliance can be found in our download section.

Centos2.png

If you select "Install (Text mode) the installation will be performed in text mode. However, if you choose the Install option, the graphical installation will start (recommended). Choose between one of these two options, and reboot the machine after the installation.

2.2 Database restore

Template warning.png

If you use a history database, you must perform a restore of it as well.

 


2.2.1 Manual restore

Make sure that your database is up and running, and the Pandora's server and agent are stopped.

[[email protected] ~]# /etc/init.d/mysqld start
Starting mysqld: [ OK ]
[[email protected] ~]# /etc/init.d/pandora_server stop
Stopping Pandora FMS Server
[[email protected] ~]# /etc/init.d/pandora_agent_daemon stop
Stopping Pandora Agent.

Then, we restore the database

[[email protected] ~]# gunzip pandora.sql.gz
[[email protected] ~]# cat pandoradb.sql | mysql -u root -p pandora
Enter password: <enter the password in console>

Additionally we can perform the recovery in the following way.

mysql –u root –p pandora
create database pandora;
use pandora;
source PATH BACKUP;

Template warning.png

The database to be created must have the same name as the database we backed up.

 



2.2.2 Recovery through Pandora FMS Database Backup utility

Template warning.png

This functionality is only valid for those backups made using this tool.

 


Recuperacion_backup_utility.png

In order to restore a backup, we must go to the backup we want to recover from the list of backups made, and click on the option 'Rollback to this backup'. Later we will get a message in the console with the manual steps to restore the selected database.

Recuperacion_backup_utility2.png

2.3 Configuration files restore

First, we restore the agents and server configuration files:

[[email protected] ~]# tar -zxvf pandora_configuration.tar.gz -C /

2.4 Agent restore

Now, we perform the restore of the agent directory

[[email protected] ~]# tar -zxvf agent.tar.gz -C /

2.5 Server restore

2.5.1 Server plugins

We restore the pandora server main folder, and every other plugin folder that you may have.

[[email protected] ~]# tar -zxvf pandora_server.tar.gz -C /
[[email protected] ~]# tar -zxvf my_plugin_folder.tar.gz -C /

2.5.2 Remote configuration

A restore of the remote configuration files and collections must be performed in order to maintain the remote agent's normal behavior.

[[email protected] ~]# tar -zxvf collections.tar.gz -C /
[[email protected] ~]# tar -zxvf md5.tar.gz -C /
[[email protected] ~]# tar -zxvf remote_agents_conf.tar.gz -C /

2.6 Console restore

We now perform a restore of the console, so we mantain our custom images, extensions, and more.

[[email protected] ~]# tar -zxvf pandora_console.tar.gz -C /

2.7 Starting Pandora FMS server and agent

The last step, is to start the Pandora FMS server, and agent.

[[email protected] ~]# /etc/init.d/pandora_server start
[[email protected] ~]# /etc/init.d/pandora_agent_daemon start


Go Back to Pandora FMS documentation index