Table of Contents
Backup and Restore Procedures
The purpose of this document is to illustrate the Pandora FMS appliance backup and restore procedures.
Firstly, make a backup of the existing database. There are two methods available to make such backup.
If a history database is used, perform its backup as well.
Open a terminal window with the appropriate user credentials and enter the following commands (enter the access credentials for the database):
mysqldump -u <pandora_db_user> -p <pandora_db_name> | gzip> pandoradb.sql.gz <enter the password in console>
Pandora FMS Database Backup utility
Pandora FMS permite realizar de forma periodica un backup de la base de datos que podremos programar en Discovery > New console task y seleccionando en el desplegable “Backup Pandora FMS database”.
To create a new database backup:
- Select the backup frequency or one-time with “Not scheduled”.
- Select exactly when the “Next execution” backup task will be started.
- You need to indicate the content of which groups to support (or select all “All”).
- By default it is stored in
/var/www/html/pandora_console/attachment/backupsbut you can specify any directory to which you have write and read rights.
Once you have finished filling in the fields, click on the Create button.
Configuration files backup
In order to backup Pandora FMS's agents and server configuration files, type in:
tar -pcvzf pandora_configuration.tar.gz /etc/pandora/*.conf
The agent folder must also be backed-up. This is very important to keep deployed collections and agent plugins.
tar -pcvzf agent.tar.gz /usr/share/pandora_agent
Server plugin default folder is under /usr/share/pandora_server (the main Pandora FMS's server folder).
Caution: If you have server plugins placed in other folders, back them up 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 file and collection backup must be performed in order to keep the remote agent's usual performance
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
Later on, perform a console backup, to keep custom images, extensions, and more.
tar -pcvzf pandora_console.tar.gz /var/www/html/pandora_console
Install the appliance
Insert the CD in your system and press a key in the boot screen. The boot menu will be displayed then. The Appliance can be found in the download section.
If you select “Install” (Text mode), the installation will be performed in text mode. However, if the Install option is selected, the graphical installation will start (recommended). Choose between one of these two options, and reboot the machine after the installation. Detailed instructions are available at this link.
If you use a history database, restore it as well.
Make sure that your database is up and running, and the Pandora FMS's server and agent are shut down.
[[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.
From version NG 754 onwards, additional options are available for manual startup and shutdown of High Availability (HA) environments.
Then, 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>
Furthermore, the recovery can be performed in the following way.
mysql –u root –p pandora create database pandora; use pandora; source PATH BACKUP;
The database to be created must have the same name as the backed-up database.
Configuration file restore
First, restore agent and server configuration files:
[[email protected] ~]# tar -zxvf pandora_configuration.tar.gz -C /
Now, restore the agent directory.
[[email protected] ~]# tar -zxvf agent.tar.gz -C /
Restore the Pandora FMS 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 file and collection restore must be performed in order to keep the remote agent's usual performance.
[[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 /
Next, restore the console to keep your custom images, extensions, and more.
[[email protected] ~]# tar -zxvf pandora_console.tar.gz -C /