Page 1 of 1

XI scheduled backup creating folder not tar.gz files

Posted: Sun May 29, 2016 3:37 am
by zahik
hi ,
in the last days nagios scheduled backup not building tar.gz files as but folders with files ,as result the restore script won't work

good example:
nagiosxi.1462575541.tar.gz(file)
bad example:
nagiosxi.1463698741(folder)


how can i fix this ,so the files get created as a tar.gz files and not folders?
thanks

info from the backup log
05-17-2016 18:59:01 DEBUG: Running scheduled local backup ...
05-17-2016 18:59:01 INFO: Creating a local backup: nagiosxi.1463525941
05-17-2016 18:59:01 INFO: Too many backups! Limit is 21. Removing: nagiosxi.1461711541.tar.gz before proceeding with backup.
05-17-2016 18:59:02 DEBUG: Sending create local backup command to CmdSubsystem
05-18-2016 18:59:01 DEBUG: Running scheduled local backup ...
05-18-2016 18:59:01 INFO: Creating a local backup: nagiosxi.1463612341
05-18-2016 18:59:01 INFO: Too many backups! Limit is 21. Removing: nagiosxi.1461797941.tar.gz before proceeding with backup.
05-18-2016 18:59:02 DEBUG: Sending create local backup command to CmdSubsystem
05-19-2016 18:59:01 DEBUG: Running scheduled local backup ...
05-19-2016 18:59:01 INFO: Creating a local backup: nagiosxi.1463698741
05-19-2016 18:59:01 INFO: Too many backups! Limit is 21. Removing: nagiosxi.1461884341.tar.gz before proceeding with backup.
05-19-2016 18:59:02 DEBUG: Sending create local backup command to CmdSubsystem
05-20-2016 18:59:01 DEBUG: Running scheduled local backup ...
05-20-2016 18:59:01 INFO: Creating a local backup: nagiosxi.1463785141
05-20-2016 18:59:01 DEBUG: Sending create local backup command to CmdSubsystem
05-21-2016 18:59:01 DEBUG: Running scheduled local backup ...
05-21-2016 18:59:01 INFO: Creating a local backup: nagiosxi.1463871541
05-21-2016 18:59:01 DEBUG: Sending create local backup command to CmdSubsystem
05-22-2016 18:59:01 DEBUG: Running scheduled local backup ...
05-22-2016 18:59:01 INFO: Creating a local backup: nagiosxi.1463957941
05-22-2016 18:59:01 DEBUG: Sending create local backup command to CmdSubsystem
05-23-2016 18:59:01 DEBUG: Running scheduled local backup ...
05-23-2016 18:59:01 INFO: Creating a local backup: nagiosxi.1464044341
05-23-2016 18:59:01 DEBUG: Sending create local backup command to CmdSubsystem
05-24-2016 18:59:01 DEBUG: Running scheduled local backup ...
05-24-2016 18:59:01 INFO: Creating a local backup: nagiosxi.1464130741
05-24-2016 18:59:01 DEBUG: Sending create local backup command to CmdSubsystem
05-25-2016 18:59:01 DEBUG: Running scheduled local backup ...
05-25-2016 18:59:01 INFO: Creating a local backup: nagiosxi.1464217141
05-25-2016 18:59:01 DEBUG: Sending create local backup command to CmdSubsystem
05-26-2016 20:59:01 DEBUG: Running scheduled local backup ...
05-26-2016 20:59:01 INFO: Creating a local backup: nagiosxi.1464310741
05-26-2016 20:59:01 INFO: Too many backups! Limit is 14. Removing: nagiosxi.1461970741.tar.gz before proceeding with backup.
05-26-2016 20:59:02 INFO: Too many backups! Limit is 14. Removing: nagiosxi.1462057141.tar.gz before proceeding with backup.
05-26-2016 20:59:03 INFO: Too many backups! Limit is 14. Removing: nagiosxi.1462143541.tar.gz before proceeding with backup.
05-26-2016 20:59:04 INFO: Too many backups! Limit is 14. Removing: nagiosxi.1462229941.tar.gz before proceeding with backup.
05-26-2016 20:59:05 INFO: Too many backups! Limit is 14. Removing: nagiosxi.1462316341.tar.gz before proceeding with backup.
05-26-2016 20:59:06 INFO: Too many backups! Limit is 14. Removing: nagiosxi.1462402741.tar.gz before proceeding with backup.
05-26-2016 20:59:07 INFO: Too many backups! Limit is 14. Removing: nagiosxi.1462489141.tar.gz before proceeding with backup.
05-26-2016 20:59:08 DEBUG: Sending create local backup command to CmdSubsystem
05-27-2016 20:59:01 DEBUG: Running scheduled local backup ...
05-27-2016 20:59:01 INFO: Creating a local backup: nagiosxi.1464397141
05-27-2016 20:59:01 DEBUG: Sending create local backup command to CmdSubsystem
05-28-2016 20:59:01 DEBUG: Running scheduled local backup ...
05-28-2016 20:59:01 INFO: Creating a local backup: nagiosxi.1464483541
05-28-2016 20:59:01 DEBUG: Sending create local backup command to CmdSubsystem


when i run the backup i get this
[root@nagios_xi_prod scripts]# ./backup_xi.sh
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
tar: /usr/local/nagios/var/ndo.sock: socket ignored
tar: /usr/local/nagios/var: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-TPS24: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-TPS16: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-TPS47: file changed as we read it
tar: /usr/local/nagios/share/perfdata/esxny-c-01.doubleverify.prod: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-TPS33: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-TPS44: file changed as we read it
tar: /usr/local/nagios/share/perfdata/AN-LAX-JTPS02: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-BSWeb08: file changed as we read it
tar: /usr/local/nagios/share/perfdata/Dviscsi.doubleverify.prod/_HOST_.xml.25365: File removed before we read it
tar: /usr/local/nagios/share/perfdata/Dviscsi.doubleverify.prod: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-TPS32: file changed as we read it
tar: /usr/local/nagios/share/perfdata/VT13: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-TPS35: file changed as we read it
tar: /usr/local/nagios/share/perfdata/esxny-c-04.doubleverify.prod: file changed as we read it
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up Nagvis...
tar: Removing leading `/' from member names
Backing up MySQL databases...
mysqldump: Got error: 130: Incorrect file format 'tbl_logbook' when using LOCK TABLES
Error backing up MySQL database 'nagiosql' - check the password in this script!

Re: XI scheduled backup creating folder not tar.gz files

Posted: Mon May 30, 2016 2:13 am
by Box293
The source of the problem is that the database has a corruption.
Because of this the backup script fails and never completes
Hence the .tar.gz file is not completed and the directory is not deleted.

Can you please follow this article to run the database repair process:

https://support.nagios.com/kb/article.php?id=24

This may take a while to complete. Once it has, please scroll back up through the history to make sure there were not any database errors (you may see an ndo2db error when stopping the service but this is ok).

Once this is done, re-run the manual backup to confirm it is completing OK.

You will need to manually delete those folders as the backup routine will not clean them up.

Re: XI scheduled backup creating folder not tar.gz files

Posted: Mon May 30, 2016 3:07 am
by zahik
hi thanks for the response
run the command
/usr/local/nagiosxi/scripts/repair_databases.sh

but still same error when doing manual backup
[root@nagios_xi_prod scripts]# ./backup_xi.sh
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
tar: /usr/local/nagios/var/ndo.sock: socket ignored
tar: /usr/local/nagios/var: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-TPS16: file changed as we read it
tar: /usr/local/nagios/share/perfdata/WC-jTPS-RTB-Turn01: file changed as we read it
tar: /usr/local/nagios/share/perfdata/nycp-dv-asld02.doubleverify.prod: file changed as we read it
tar: /usr/local/nagios/share/perfdata/AppNexus-JTPS03: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-TPS17: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-TPS48: file changed as we read it
tar: /usr/local/nagios/share/perfdata/jTPS-RTB-Yahoo04: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-BSWeb08: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-TPS15: file changed as we read it
tar: /usr/local/nagios/share/perfdata/VT_Vertica_result_sets_extractor: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-TPS31: file changed as we read it
tar: /usr/local/nagios/share/perfdata/AN-LAX-JTPS03: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-TPS10: file changed as we read it
tar: /usr/local/nagios/share/perfdata/USNJ-TPS14: file changed as we read it
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up Nagvis...
tar: Removing leading `/' from member names
Backing up MySQL databases...
mysqldump: Got error: 130: Incorrect file format 'tbl_logbook' when using LOCK TABLES
Error backing up MySQL database 'nagiosql' - check the password in this script!


this is the mysql log
[root@nagios_xi_prod scripts]# tail /var/log/mysqld.log
160530 3:26:47 [Note] /usr/libexec/mysqld: Shutdown complete

160530 03:26:47 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
160530 03:26:49 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
160530 3:26:49 InnoDB: Initializing buffer pool, size = 8.0M
160530 3:26:49 InnoDB: Completed initialization of buffer pool
160530 3:26:49 InnoDB: Started; log sequence number 0 44273
160530 3:26:49 [Note] Event Scheduler: Loaded 0 events
160530 3:26:49 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

Re: XI scheduled backup creating folder not tar.gz files

Posted: Mon May 30, 2016 9:16 pm
by Box293
There is still an issue with the database.

Can you please run the repair script again and post the entire output that the repair script generates.

Re: XI scheduled backup creating folder not tar.gz files

Posted: Sun Jun 26, 2016 2:59 am
by zahik
fixed the bad table using other tools from the net ,backup now work well
thanks for pointing me to the write direction

Re: XI scheduled backup creating folder not tar.gz files

Posted: Mon Jun 27, 2016 9:22 am
by mcapra
Is it alright if we mark this issue as resolved and lock the thread?

Re: XI scheduled backup creating folder not tar.gz files

Posted: Sat Feb 25, 2017 5:55 am
by zahik
yes ,cant find how to close it my self
thanks for the help

Re: XI scheduled backup creating folder not tar.gz files

Posted: Mon Feb 27, 2017 10:43 am
by dwhitfield
I don't think can. :) I will lock.