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 v4.1 appliance.

1.2 Database backup

First, we need to backup the existing database:

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

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

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

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

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

Then, we restore the database

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

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

2.3 Configuration files restore

First, we restore the agents and server configuration files:

[root@localhost ~]# tar -zxvf pandora_configuration.tar.gz -C /

2.4 Agent restore

Now, we perform the restore of the agent directory

[root@localhost ~]# 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.

[root@localhost ~]# tar -zxvf pandora_server.tar.gz -C /
[root@localhost ~]# 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.

[root@localhost ~]# tar -zxvf collections.tar.gz -C /
[root@localhost ~]# tar -zxvf md5.tar.gz -C /
[root@localhost ~]# 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.

[root@localhost ~]# 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.

[root@localhost ~]# /etc/init.d/pandora_server start
[root@localhost ~]# /etc/init.d/pandora_agent_daemon start

Go Back to Pandora FMS documentation index