Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Context

To prevent data-loss after a crash of one or several servers used in your Shinken architecture, we advise to use the shinken-backup and shinken-restore commands.

These two commands allow to save and restore a part or all of the Shinken configuration on a Shinken server.


Panel
titleSommaire

Table of Contents


Backup command

Utilization

The basic command to use to perform a complete backup of Shinken Enterprise data is the following:

Code Block
shinken-backup

A lot of different parameters can alter what is put in the backup archive:

OptionShort optionDescriptionDaemon containing data to backup
--help-hDisplays the command's helpAll
--sla-sSaves SLA dataBroker
--user-uSaves data of users from the Visualization UI (custom lists, dashboards and hives, ...)Broker
--configuration-cSaves configuration data (hosts, checks, templates, users, ...)Synchronizer
--metrology-mSaves metrology data (metrics)Broker
--log-lSaves logsAll
--output-directory [dir]-od [dir]Allows to choose where to put the data
--output-name [name]-on [name]Allows to choose a name for the backup archive


Info

Because the shinken-backup command saves the content of /etc/shinken et /etc/shinken-user folders, it can be used when executed from these folders.

Also, check that you use this backup tool on the correct server. For example, trying to save SLA data on a Poller server will not save any actual SLA data, because SLA data are stored on the Broker server.

 

Saving data in encrypted configurations

When performing a backup of configuration data containing encrypted data, the shinken-backup command displays a warning if the encryption key has not been exported.

The backup is still performed, but you need to export and save your encryption key using the 

Lorsqu'un backup de données de configuration avec des données protégées est effectué, shinken-backup affiche un avertissement si la clé n'a pas été sauvegardée.

Le backup est tout de même effectué mais vous devez effectuer une sauvegarde de la clé en utilisant la commande shinken-protected-fields-keyfile-export avant toute autre opération impliquant un changement de clé.

Le message suivant apparaîtra si vous n'avez pas effectué de sauvegarde de la clé avant la sauegarde de la configuration :

The protected fields key from this backup looks like it has never been saved

before any other manipulation related to encryption.


The following messageis displayed if you did not save the encryption key before performing a configuration backup:


Code Block
The protected fields key from this backup looks like it has never been saved


If the key export is done after the backup, you can ignore this backup and restore the key using the shinken-protected-fields-keyfile-restore commandSi la sauvegarde de la clé a été effectuée par la suite, vous pouvez ignorer ce message et restaurer la clé selon la la procédure de restoration habituelle.


Panel

Exemples


Examples

Here is an example of a complete backup of a server hosting all of the Shinken Enterprise daemonsVoici un exemple de sauvegarde complete d'un serveur hébergeant l'ensemble des démons :

Code Block
root@vm-shinken: ~
$ shinken-backup
Saving Sla
  Sla save size: 360M
Saving User
  User save size: 72K
Saving Configuration
  Configuration save size: 8.0M
Saving Metrology
  Metrology save size: 3.9M
Saving Logs
  Logs save size: 2.8M

Done : your backup directory is /root/shinken-backups/2017-11-13__17-50-33

Exemple de la sauvegarde de la configuration sur un serveur hébergeant le démon Synchronizer :

This example backs up the configuration of a Shinken server hosting the Synchronizer daemon:

Code Block
root@vm-shinken: ~
$ shinken-backup --configuration
Saving Configuration
  Configuration save size: 3.1M

Done : your backup directory is /root/shinken-backups/2017-11-10__17-46-11

Commande de restauration


Restore command

Utilization

Utilisation


Code Block
shinken-restore DIRECTORY-TO-RESTORE


Le dossier "The DIRECTORY-TO-RESTORE " doit contenir les dossiers de backups comme : configuration/ metrology/ user/ sla/ context/

Les différences options possibles :

folder should contain the backup folder, such as :

  • configuration/
  • metrology/
  • user/
  • sla/
  • context/


The different options available on the restore command are:

OptionShort optionDescriptionDaemon containing data to backupOptionOption courtDescriptionDémon sur lequel se trouve les données à restaurer
--help-hAffiche l'aide de la commandeDisplays the command's helpAllTous
--sla-sRestaure les données Restores SLA dataBroker
--user-uRestaure les données des utilisateurs de l'UI de visualisation (portails, listes, favoris, tableaux de bordsRestores user data in the visualization UI (lists, hives, dashboards, favorites, ...)Broker
--restore-only-user [USER]

Restores the UI Visualization data (lists, hives, dashboards, favorites...) only for the specified user (to use with the -u option)

(lightbulb) This option does not require restarting

Restaure les données de l'UI de visualisation (portails, listes, favoris, tableaux de bords..) pour l'utilisateur spécifié - à utiliser avec l'option -u

(lightbulb) Cette option ne demande pas le redémarrage de Shinken

Broker
--configuration-cRestaure les données de Restores configuration dataSynchronizer
--with-key-backup [HASH]

For a backup containing encrypted data, also restore the enryption key specified ([HASH]). This hash to pass as parameter is the output of the shinken-protected-fields-keyfile-export command)

Pour un backup contenant des données protégées, restaure également la clé de chiffrement spécifiée. Il s'agit du résultat de la commande shinken-protected-fields-keyfile-export.

Synchronizer
--metrology-mRestaure les données de métrologieRestores metrology data (metrics).Broker
--log-lRestaure les Restores logsTous

Restauration d'une base de données de configuration dont les données sensibles sont chiffrées

All


Restoration of a encrypted configuration database

The shinken-restore command will restore the backup data, but will ask to also restore the encryption key to be able to read the data.

  • The Synchronizer daemon will refuse to start until the encryption key is restored


The shinken-restore also has a

Shinken-restore mettra en place votre sauvegarde, mais vous demandera de restaurer la clé.

  • Le Synchronizer refusera de démarrer tant que la clé n'est pas restaurée.

Le shinken-restore met aussi l'option --with-key-backup  qui vous permet de faire la restauration et de placer automatiquement la clef fournie. Vous aurez juste en suivant à redémarrer le Synchronizer.that allows to perform the data restoration and restore the encryption key as the same time. You just have to restart the Synchronizer daemon after thaat:

Code Block
/etc/init.d/shinken-synchronizer start


If you lost your key, the Si vous avez égaré votre clé, nous vous conseillons de lire la page de la documentation "shinken-protected-fields-keyfile-rescue-from-backup". Cette commande vous permettre de restaurer votre clef via l'intermédiaire du support Shinken documentation describes the procedure to an encryption to read your data with the help of your Shinken support.


Panel

Exemples


Examples

Here is an example of a complete restore on a server hosting all of the Shinken Enterprise daemons from the Voici un exemple de restauration d'un backup complet Shinken depuis le dossier ~/shinken-backups folder:

Code Block
root@vm-shinken: ~/shinken-backups

$ shinken-restore 2017-11-09__16-16-53

Stopping Shinken before restoring
Restoring from 02.04.01.fr to 02.04.02.fr
-Restoring Sla            DONE
-Restoring User           DONE
-Restoring Configuration  DONE
-Restoring Metrology      DONE
-Restoring Logs           DONE

Sanatizing your restored data
   fix_double_link                         :   skip (unecessary)
   fix_double_sync_keys                    :   skip (unecessary)
   fix_default_item_se_uuid                :   skip (unecessary)
   fix_remove_shinken_core                 :   skip (unecessary)
   fix_remove_deprecated_check             :   skip (unecessary)
   fix_remove_undefined_aix_templates      :   skip (unecessary)
   fix_flapping_thresholds                 :   skip (unecessary)
   fix_business_impact                     :   skip (unecessary)

Done. You can restart your shinken with /etc/init.d/shinken start


Info

Après la restauration des données, des scripts de "Sanatize" sont lancés. Ces scripts permettent, si nécessaire, de réparer certaines incohérences dans vos données.

Une fois la restauration terminée, vous devez démarrer Shinken.

After restoring your data, sanitazation scripts are launched to make sure the restored data is compatible with the Shinken Enterprise version installed on your system.

Once a restoration complete, you can restart the Shinken daemons:

Code Block
/etc/init.d/shinken start



This example restore Shinken Enterprise configuration data, on a server hosting the Synchronizer/Arbiter daemons.Voici un autre exemple de restauration d'un backup de la configuration de Shinken, lancé depuis le serveur hébergeant l'Arbiter/Synchronizer :

Code Block
root@vm-shinken: ~/shinken-backups

$ shinken-restore --configuration 2017-11-08__10-58-54

Stopping Shinken before restoring
Restoring from 02.04.01-release to 02.04.02-release
-Restoring Configuration  DONE

Sanatizing your restored data
   fix_double_link                         :   executed [OK]
   fix_double_sync_keys                    :   skip (unecessary)
   fix_default_item_se_uuid                :   skip (unecessary)
   fix_remove_shinken_core                 :   skip (unecessary)
   fix_remove_deprecated_check             :   skip (unecessary)
   fix_remove_undefined_aix_templates      :   skip (unecessary)
   fix_flapping_thresholds                 :   skip (unecessary)
   fix_business_impact                     :   skip (unecessary)

Done. You can restart your shinken with /etc/init.d/shinken start
Voici un dernier exemple de restauration d'un backup des données de l'utilisateur "monutilisateur" de Shinken (portails, listes, favoris, tableaux de bords), lancé depuis le serveur hébergeant le Broker


This last example restore the Visualization UI data of the Shinken user "testuser" (hives, lists, dashboards, favorites...), launched on the server hosting the Broker daemon:

Code Block
root@vm-shinken: ~/shinken-backups

$ shinken-restore -u --restore-only-user monutilisateurtestuser 2017-12-13__11-44-49/
Restoring from 02.04.01-release to 02.04.03-release
-Restoring User
 Restoring only the user monutilisateurtestuser

Restore of the user monutilisateurtestuser data is OK