Page 1 of 2

Local Backups are not getting archived

Posted: Mon Jun 15, 2015 7:57 am
by blueagle
I've searched the forum and Google for quite some time now but I just can't find a solution to my problem.
Nagios XI is creating daily backups but these backups are in directory structure and aren't archived.
[nagios@nagios nagiosxi]$ ls -ltrh
total 40K
drwxrwxr-x 4 nagios nagcmd 4.0K Jun 8 00:54 nagiosxi.1433718003
drwxrwxr-x 4 nagios nagcmd 4.0K Jun 9 00:50 nagiosxi.1433804402
drwxrwxr-x 4 nagios nagcmd 4.0K Jun 10 00:52 nagiosxi.1433890802
drwxrwxr-x 4 nagios nagcmd 4.0K Jun 11 14:08 nagiosxi.1434025742
drwxrwxr-x 4 nagios nagcmd 4.0K Jun 12 00:37 nagiosxi.1434063602
drwxrwxr-x 4 nagios nagcmd 4.0K Jun 13 00:39 nagiosxi.1434150002
drwxrwxr-x 4 nagios nagcmd 4.0K Jun 14 00:37 nagiosxi.1434236403
drwxrwxr-x 4 nagios nagcmd 4.0K Jun 15 00:39 nagiosxi.1434322802
drwxrwxr-x 4 nagios nagcmd 4.0K Jun 15 13:26 1434368572

I created the last one manually earlier today and even that one isn't archived. I think this is also the reason Nagios isn't deleting the old backups. At the moment I'm deleting old ones manually but I would like it fixed.

Please let me know if you'd like more information. Thanks

Moderator's Note: I had to move your post to Nagios XI general support forum. I seems like you accidentally posted on the Nagios Core support forum. Thanks!

Re: Local Backups are not getting archived

Posted: Mon Jun 15, 2015 9:13 am
by tmcdonald
What version of XI is this on? Any errors about a failed gzip nin /var/log/messages? Those permissions look a bit off - what are the directory permissions on /store/backups/nagiosxi (or whatever backup directory you have)?

Re: Local Backups are not getting archived

Posted: Mon Jun 15, 2015 3:47 pm
by blueagle
Version number is
Nagios XI 2014R2.3
Permissions:
[root@nagios log]# cd /store/backups/
[root@nagios backups]# ls -l
total 12
drwxr-xr-x. 5 root root 4096 Jun 15 07:00 mysql
drwxrwxr-x. 10 nagios nagcmd 4096 Jun 15 14:04 nagiosxi
drwxr-xr-x. 5 root root 4096 Jun 15 08:00 postgresql

I couldn't find anything in the messages log for gzip.

Re: Local Backups are not getting archived

Posted: Mon Jun 15, 2015 3:58 pm
by tgriep
Could you run the following and post the output back here?

Code: Select all

tail -100 /usr/local/nagiosxi/var/components/scheduledbackups.log
df -h
df -i
du /store/backups

Re: Local Backups are not getting archived

Posted: Tue Jun 16, 2015 3:18 am
by blueagle
This is what you've requested.

[nagios@nagios nagiosxi]$ tail -100 /usr/local/nagiosxi/var/components/scheduledbackups.log
05-14-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
05-15-2015 00:00:02 DEBUG: Running scheduled local backup ...
05-15-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1431644402
05-15-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
05-16-2015 00:00:02 DEBUG: Running scheduled local backup ...
05-16-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1431730802
05-16-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
05-17-2015 00:00:02 DEBUG: Running scheduled local backup ...
05-17-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1431817202
05-17-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
05-18-2015 00:00:02 DEBUG: Running scheduled local backup ...
05-18-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1431903602
05-18-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
05-19-2015 00:00:02 DEBUG: Running scheduled local backup ...
05-19-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1431990002
05-19-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
05-20-2015 00:00:02 DEBUG: Running scheduled local backup ...
05-20-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1432076402
05-20-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
05-21-2015 00:00:02 DEBUG: Running scheduled local backup ...
05-21-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1432162802
05-21-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
05-22-2015 00:00:02 DEBUG: Running scheduled local backup ...
05-22-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1432249202
05-22-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
05-23-2015 00:00:02 DEBUG: Running scheduled local backup ...
05-23-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1432335602
05-23-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
05-24-2015 00:00:02 DEBUG: Running scheduled local backup ...
05-24-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1432422002
05-24-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
05-25-2015 00:00:02 DEBUG: Running scheduled local backup ...
05-25-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1432508402
05-25-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
05-26-2015 00:00:03 DEBUG: Running scheduled local backup ...
05-26-2015 00:00:03 INFO: Creating a local backup: nagiosxi.1432594803
05-26-2015 00:00:03 DEBUG: Sending create local backup command to CmdSubsystem
05-27-2015 00:00:02 DEBUG: Running scheduled local backup ...
05-27-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1432681202
05-27-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
05-28-2015 00:00:03 DEBUG: Running scheduled local backup ...
05-28-2015 00:00:03 INFO: Creating a local backup: nagiosxi.1432767603
05-28-2015 00:00:03 DEBUG: Sending create local backup command to CmdSubsystem
05-29-2015 00:00:03 DEBUG: Running scheduled local backup ...
05-29-2015 00:00:03 INFO: Creating a local backup: nagiosxi.1432854003
05-29-2015 00:00:03 DEBUG: Sending create local backup command to CmdSubsystem
05-30-2015 00:00:02 DEBUG: Running scheduled local backup ...
05-30-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1432940402
05-30-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
05-31-2015 00:00:02 DEBUG: Running scheduled local backup ...
05-31-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1433026802
05-31-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
06-01-2015 00:00:03 DEBUG: Running scheduled local backup ...
06-01-2015 00:00:03 INFO: Creating a local backup: nagiosxi.1433113203
06-01-2015 00:00:03 DEBUG: Sending create local backup command to CmdSubsystem
06-02-2015 00:00:03 DEBUG: Running scheduled local backup ...
06-02-2015 00:00:03 INFO: Creating a local backup: nagiosxi.1433199603
06-02-2015 00:00:03 DEBUG: Sending create local backup command to CmdSubsystem
06-03-2015 00:00:03 DEBUG: Running scheduled local backup ...
06-03-2015 00:00:03 INFO: Creating a local backup: nagiosxi.1433286003
06-03-2015 00:00:03 DEBUG: Sending create local backup command to CmdSubsystem
06-04-2015 00:00:02 DEBUG: Running scheduled local backup ...
06-04-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1433372402
06-04-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
06-05-2015 00:00:02 DEBUG: Running scheduled local backup ...
06-05-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1433458802
06-05-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
06-06-2015 00:00:02 DEBUG: Running scheduled local backup ...
06-06-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1433545202
06-06-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
06-07-2015 00:00:02 DEBUG: Running scheduled local backup ...
06-07-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1433631602
06-07-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
06-08-2015 00:00:03 DEBUG: Running scheduled local backup ...
06-08-2015 00:00:03 INFO: Creating a local backup: nagiosxi.1433718003
06-08-2015 00:00:03 DEBUG: Sending create local backup command to CmdSubsystem
06-09-2015 00:00:02 DEBUG: Running scheduled local backup ...
06-09-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1433804402
06-09-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
06-10-2015 00:00:02 DEBUG: Running scheduled local backup ...
06-10-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1433890802
06-10-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
06-11-2015 13:29:02 DEBUG: Running scheduled local backup ...
06-11-2015 13:29:02 INFO: Creating a local backup: nagiosxi.1434025742
06-11-2015 13:29:02 DEBUG: Sending create local backup command to CmdSubsystem
06-12-2015 00:00:02 DEBUG: Running scheduled local backup ...
06-12-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1434063602
06-12-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
06-13-2015 00:00:02 DEBUG: Running scheduled local backup ...
06-13-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1434150002
06-13-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
06-14-2015 00:00:03 DEBUG: Running scheduled local backup ...
06-14-2015 00:00:03 INFO: Creating a local backup: nagiosxi.1434236403
06-14-2015 00:00:03 DEBUG: Sending create local backup command to CmdSubsystem
06-15-2015 00:00:02 DEBUG: Running scheduled local backup ...
06-15-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1434322802
06-15-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem
06-16-2015 00:00:02 DEBUG: Running scheduled local backup ...
06-16-2015 00:00:02 INFO: Creating a local backup: nagiosxi.1434409202
06-16-2015 00:00:02 DEBUG: Sending create local backup command to CmdSubsystem

[nagios@nagios nagiosxi]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg1-lv_root
122G 41G 75G 36% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/sda1 485M 124M 336M 27% /boot

[nagios@nagios nagiosxi]$ df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/mapper/vg1-lv_root
8030464 515211 7515253 7% /
tmpfs 490585 1 490584 1% /dev/shm
/dev/sda1 128016 62 127954 1% /boot

[nagios@nagios nagiosxi]$ du -h /store/backups/
8.0K /store/backups/nagiosxi/nagiosxi.1434150002/mysql
4.0K /store/backups/nagiosxi/nagiosxi.1434150002/conf.d
425M /store/backups/nagiosxi/nagiosxi.1434150002
8.0K /store/backups/nagiosxi/nagiosxi.1433890802/mysql
4.0K /store/backups/nagiosxi/nagiosxi.1433890802/conf.d
3.2G /store/backups/nagiosxi/nagiosxi.1433890802
8.0K /store/backups/nagiosxi/nagiosxi.1434063602/mysql
4.0K /store/backups/nagiosxi/nagiosxi.1434063602/conf.d
398M /store/backups/nagiosxi/nagiosxi.1434063602
8.0K /store/backups/nagiosxi/nagiosxi.1433718003/mysql
4.0K /store/backups/nagiosxi/nagiosxi.1433718003/conf.d
3.2G /store/backups/nagiosxi/nagiosxi.1433718003
8.0K /store/backups/nagiosxi/nagiosxi.1434322802/mysql
4.0K /store/backups/nagiosxi/nagiosxi.1434322802/conf.d
480M /store/backups/nagiosxi/nagiosxi.1434322802
8.0K /store/backups/nagiosxi/nagiosxi.1434236403/mysql
4.0K /store/backups/nagiosxi/nagiosxi.1434236403/conf.d
452M /store/backups/nagiosxi/nagiosxi.1434236403
8.0K /store/backups/nagiosxi/nagiosxi.1433804402/mysql
4.0K /store/backups/nagiosxi/nagiosxi.1433804402/conf.d
3.2G /store/backups/nagiosxi/nagiosxi.1433804402
8.0K /store/backups/nagiosxi/nagiosxi.1434409202/mysql
4.0K /store/backups/nagiosxi/nagiosxi.1434409202/conf.d
507M /store/backups/nagiosxi/nagiosxi.1434409202
4.0K /store/backups/nagiosxi/nagiosxi.1434025742/mysql
4.0K /store/backups/nagiosxi/nagiosxi.1434025742/conf.d
386M /store/backups/nagiosxi/nagiosxi.1434025742
12G /store/backups/nagiosxi
312K /store/backups/postgresql/daily/nagiosxi
28K /store/backups/postgresql/daily/postgres
28K /store/backups/postgresql/daily/template1
372K /store/backups/postgresql/daily
1.2M /store/backups/postgresql/weekly/nagiosxi
128K /store/backups/postgresql/weekly/postgres
128K /store/backups/postgresql/weekly/template1
1.5M /store/backups/postgresql/weekly
540K /store/backups/postgresql/monthly/nagiosxi
64K /store/backups/postgresql/monthly/postgres
64K /store/backups/postgresql/monthly/template1
672K /store/backups/postgresql/monthly
2.5M /store/backups/postgresql
28K /store/backups/mysql/daily/test
288K /store/backups/mysql/daily/nagiosql
728K /store/backups/mysql/daily/mysql
28K /store/backups/mysql/daily/nagios
1.1M /store/backups/mysql/daily
128K /store/backups/mysql/weekly/test
1.6M /store/backups/mysql/weekly/nagiosql
4.4M /store/backups/mysql/weekly/mysql
137M /store/backups/mysql/weekly/nagios
143M /store/backups/mysql/weekly
64K /store/backups/mysql/monthly/test
764K /store/backups/mysql/monthly/nagiosql
2.2M /store/backups/mysql/monthly/mysql
678M /store/backups/mysql/monthly/nagios
681M /store/backups/mysql/monthly
824M /store/backups/mysql
13G /store/backups/

Re: Local Backups are not getting archived

Posted: Tue Jun 16, 2015 10:18 am
by lmiltchev
If your backups are quite large, it may take longer time before they are compressed, so you may be hitting a timeout...

What is the "Scheduled Backups" component version number that you see under the "Manage Components" page?

Admin->Manage Components

If you are using the latest version of the components, you could try to increase the timeout (I believe the default is 20 min.), by adding the following line to the "/usr/local/nagiosxi/html/config.inc.php":

Code: Select all

$cfg['backup_timeout'] = 3600;
This will set the timeout at 1 hour. Restart apache:

Code: Select all

service httpd restart
Remove the incomplete backups (folders) from the "/store/backups/nagiosxi/" and try running the scheduled backup again.

If this is not helping, start a running tail on the "cmdsubsys.log":

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log
schedule a local backup from the web UI in the near future, i.e. in a few minutes, and watch the tail. After it is complete, copy/paste the output on the forum.

Re: Local Backups are not getting archived

Posted: Mon Jun 22, 2015 11:23 pm
by blueagle
Sorry for late update, I was on holidays.

I've set the timeout to 3600 as suggested. Restarted the Apache service and ran the backups, but I'm still getting the same issue. I've got the backups but they aren't getting archived.

Code: Select all

[root@nagios nagiosxi]# tail -f /usr/local/nagiosxi/var/cmdsubsys.log

.....................
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

.PROCESSING COMMAND ID 5276...
PROCESS COMMAND: CMD=1117, DATA=a:2:{i:0;s:19:"nagiosxi.1434967802";i:1;s:24:"/store/backups/nagiosxi/";}
CMDLINE=/usr/local/nagiosxi/scripts/backup_xi.sh -n nagiosxi.1434967802 -d /store/backups/nagiosxi
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/ndo.sock: socket ignored
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

...........................................................
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

...........................................................
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

............................................................tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

............................................................tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

............................................................tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated


PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

............................................................tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

..
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

...........................................................
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

............................................................tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

..
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

...........................................................tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

............................................................tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

.
PROCESSED 0 COMMANDS
tar: /usr/local/nagios/var/spool/perfdata: file changed as we read it
tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
tar: /usr/local/nagios/var/nagios.log: file changed as we read it
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tar: /usr/local/nagios/var/service-perfdata: file changed as we read it
tar: /usr/local/nagios/var: file changed as we read it
Backing up Nagios XI...
tar: Removing leading `/' from member names
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

..tar: /usr/local/nagiosxi/tmp/component-ldapauth.zip: Cannot open: Permission denied
tar: /usr/local/nagiosxi/tmp/component-globaleventhandler.zip: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up MySQL databases...
mysqldump: Got error: 144: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed when using LOCK TABLES
Error backing up MySQL database 'nagios' - check the password in this script!
OUTPUT=Error backing up MySQL database 'nagios' - check the password in this script!
RETURNCODE=2

PROCESSED 1 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated

PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS

Could it be related to the MySQL errors I'm seeing? If so how would I go ahead to identify/fix those issues?
Thanks

Re: Local Backups are not getting archived

Posted: Tue Jun 23, 2015 12:02 pm
by lmiltchev
Yes, it seems that you will need to repair the database.

https://assets.nagios.com/downloads/nag ... tabase.pdf

Also, you may want to remove the offending files from the "/usr/local/nagiosxi/tmp/" directory:
..tar: /usr/local/nagiosxi/tmp/component-ldapauth.zip: Cannot open: Permission denied
tar: /usr/local/nagiosxi/tmp/component-globaleventhandler.zip: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
as tar is failing because of permission issues.

Re: Local Backups are not getting archived

Posted: Wed Jun 24, 2015 6:12 am
by blueagle
Did as you suggested:
Ran the DB repair script and this the output, I've only copied last few lines:

Code: Select all

- recovering (with sort) MyISAM-table 'nagios_timeperiod_timeranges.MYI'
Data records: 82
- Fixing index 1
- Fixing index 2
Starting mysqld:                                           [  OK  ]
/store/backups/mysql/daily
 
===============
REPAIR COMPLETE
===============
Then I deleted the files you had mentioned from the tmp location and ran the backup, I can see the backup directory is there but its not archived.
Also I'm still seeing DB related errors in /var/log/messages:

Jun 24 12:08:48 nagios ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_logentries SET instance_id='1', logentry_time=FROM_UNIXTIME(1435144128), entry_time=FROM_UNIXTIME(1435144128), entry_time_usec='721697', logentry_type='2', logentry_data='Worker 5941: Unknown jobtype: 10', realtime_data='1', inferred_data_extracted='1''

Re: Local Backups are not getting archived

Posted: Wed Jun 24, 2015 12:58 pm
by ssax
Now that you have done those things, please tail another backup for us and post it so we can see what is occurring:

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log