Sommaire

Création d'une sauvegarde de la base de données

[YYYY-MM-DD HH:MM:SS] INFO   : [ synchronizer-module-database-backup ] [ BACKUP ] Start thread
[YYYY-MM-DD HH:MM:SS] INFO   : [ synchronizer-module-database-backup ] [ BACKUP ] Dumping mongo database [ synchronizer ]
[YYYY-MM-DD HH:MM:SS] INFO   : [ synchronizer-module-database-backup ] [ BACKUP ] Compressing dump directory [ /var/shinken-user/backup/synchronizer-module-database-backup/2021-08-06_15-08_synchronizer_localhost ] into [ 2021-08-06_15-08_synchronizer_localhost.tgz ]
[YYYY-MM-DD HH:MM:SS] INFO   : [ synchronizer-module-database-backup ] [ BACKUP ] Cleaning dump directory [ /var/shinken-user/backup/synchronizer-module-database-backup/2021-08-06_15-08_synchronizer_localhost ]
[YYYY-MM-DD HH:MM:SS] INFO   : [ synchronizer-module-database-backup ] [ BACKUP ] Archive created [/var/shinken-user/backup/synchronizer-module-database-backup/2021-08-06_15-08_synchronizer_localhost.tgz] in 3.010s

Exemple de cas d'erreur

En cas de perte de connexion à Mongo

Lorsque Mongo est indisponible, le module log qu'il n'a pas pu se connecter et il se reconnectera au prochain déclenchement

[YYYY-MM-DD HH:MM:SS] INFO   : [ synchronizer-module-database-backup ] [ MONGO ] Mongo raised ( could not connect to XXX.XXX.XXX.XXX:27017: [Errno 111] Connection refused ) on the operation list_name_collections. Operation failed : 1/5
[YYYY-MM-DD HH:MM:SS] INFO   : [ synchronizer-module-database-backup ] [ MONGO ] Mongo raised ( [Errno 111] Connection refused ) on the operation list_name_collections. Operation failed : 2/5
[YYYY-MM-DD HH:MM:SS] INFO   : [ synchronizer-module-database-backup ] [ MONGO ] Mongo raised ( [Errno 111] Connection refused ) on the operation list_name_collections. Operation failed : 3/5
[YYYY-MM-DD HH:MM:SS] INFO   : [ synchronizer-module-database-backup ] [ MONGO ] Mongo raised ( [Errno 111] Connection refused ) on the operation list_name_collections. Operation failed : 4/5
[YYYY-MM-DD HH:MM:SS] ERROR  : [ synchronizer-module-database-backup ] [ MONGO ] Mongo raised ( [Errno 111] Connection refused ) on the operation list_name_collections. Operation failed : 5/5. We tried 5 times but it kept failing.
[YYYY-MM-DD HH:MM:SS] ERROR  : [ synchronizer-module-database-backup ] [ BACKUP           ] The backup was not completed due to a connection problem with MongoDb, Aborting.

Erreur sur la configuration des WorkingHours

Lorsque les paramètres "work_hours_start" et "work_hours_end" ne sont pas cohérentes ( comme l'heure de fin avant l'heure de début ) :

[YYYY-MM-DD HH:MM:SS] ERROR  : [ SYNCHRONIZER_NAME ] [ synchronizer-module-database-backup ] WorkHours configuration : The work_hours end before start : work_hours_start [23:00:00] work_hours_end [18:00:00].
[YYYY-MM-DD HH:MM:SS] ERROR  : [ SYNCHRONIZER_NAME ] [ synchronizer-module-database-backup ] There is a problem in the work_hours configuration. Will disable the option use_work_hours.

Lorsque les paramètres "work_hours_start" ou "work_hours_end" contiennent des valeurs incorrectes

[YYYY-MM-DD HH:MM:SS] ERROR  : [ SYNCHRONIZER_NAME ] [ synchronizer-module-database-backup ] The work_hours_start parameter is malformed [26:abcd]. Must be "HH:MM"
[YYYY-MM-DD HH:MM:SS] ERROR  : [ SYNCHRONIZER_NAME ] [ synchronizer-module-database-backup ] There is a problem in the work_hours configuration. Will disable the option use_work_hours.

Lorsque le paramètre "days_worked" contient des valeurs incorrectes

[YYYY-MM-DD HH:MM:SS] ERROR  : [ SYNCHRONIZER_NAME ] [ synchronizer-module-database-backup ] The days_worked parameter is malformed [12~zzz]. Must be "X-Y"
[YYYY-MM-DD HH:MM:SS] ERROR  : [ SYNCHRONIZER_NAME ] [ synchronizer-module-database-backup ] There is a problem in the work_hours configuration. Will disable the option use_work_hours.

Cas d'erreurs non gérées

Les erreurs non gérées affichent une Traceback permettant de connaitre la nature de l'erreur

[YYYY-MM-DD HH:MM:SS] ERROR  : [ synchronizer-module-database-backup ] [ BACKUP ] Cannot create the full tree. Permission denied : /var/shinken-user/backup/synchronizer-module-database-backup/2021-08-10_16-56_synchronizer_localhost
[YYYY-MM-DD HH:MM:SS] ERROR  : [ synchronizer-module-database-backup ] [ BACKUP ] An error occured during the backup, aborting :
[YYYY-MM-DD HH:MM:SS] ERROR  : [ synchronizer-module-database-backup ] [ BACKUP ] ERROR stack : Traceback (most recent call last):
[YYYY-MM-DD HH:MM:SS] ERROR  : [ synchronizer-module-database-backup ] [ BACKUP ]   File "/var/lib/shinken/modules/synchronizer-module-database-backup/module.py", line 238, in backup_thread
[YYYY-MM-DD HH:MM:SS] ERROR  : [ synchronizer-module-database-backup ] [ BACKUP ]     self._do_backup_thread(start_time, backup_name, full_backup_directory_name)
[YYYY-MM-DD HH:MM:SS] ERROR  : [ synchronizer-module-database-backup ] [ BACKUP ]   File "/var/lib/shinken/modules/synchronizer-module-database-backup/module.py", line 252, in _do_backup_thread
[YYYY-MM-DD HH:MM:SS] ERROR  : [ synchronizer-module-database-backup ] [ BACKUP ]     self.dump_mongo_database(full_backup_directory_name)
[YYYY-MM-DD HH:MM:SS] ERROR  : [ synchronizer-module-database-backup ] [ BACKUP ]   File "/var/lib/shinken/modules/synchronizer-module-database-backup/module.py", line 301, in dump_mongo_database
[YYYY-MM-DD HH:MM:SS] ERROR  : [ synchronizer-module-database-backup ] [ BACKUP ]     raise e
[YYYY-MM-DD HH:MM:SS] ERROR  : [ synchronizer-module-database-backup ] [ BACKUP ] OSError: [Errno 13] Cannot create the full tree. Permission denied : u'/var/shinken-user/backup/synchronizer-module-database-backup/2021-08-10_16-56_synchronizer_localhost'