Pandora: Documentation en: Backup and restore procedures

From Pandora FMS Wiki
Jump to: navigation, search

Go back to Pandora FMS documentation index

Backup procedure

Purpose

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

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.

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

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

Server backup

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

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

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

Restore procedure

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.

Database 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>

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

Configuration files restore

First, we restore the agents and server configuration files:

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

Agent restore

Now, we perform the restore of the agent directory

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

Server restore

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 /

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 /

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 /

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