Page 1 of 1

RESOLVED: Email that Backup failed, but log file shows it completed

Posted: Tue Apr 15, 2025 8:19 am
by gregbeyer
Hi I run a backup nightly. Every morning I find this email:

The scheduled local backup at 2025-04-15 01:25:02 failed.

Last output from the system:

View your full scheduled backup logs at /usr/local/nagiosxi/var/components/scheduledbackups.log to find out more details about the error. Your backup may have timed out, you can set a backup_timeout variable in config.inc.php to increase it.

Yet when I view scheduledbackups.log, I find what looks like a successful backup:

cat /usr/local/nagiosxi/var/components/scheduledbackups.log
\nStarting new backup....\n
Backing up Nagios Core...
tar: Removing leading `/' from member names
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/npcd.log: 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
tar: Removing leading `/' from hard link targets
tar: /usr/local/nagiosxi/var/cmdsubsys.log: file changed as we read it
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up the SNMP directories
tar: Removing leading `/' from member names
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 nagios user home dir...
tar: Removing leading `/' from member names
Backing up MySQL databases...
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: [Warning] Using a password on the command line interface can be insecure.
Backing up cronjobs for Apache...
Backing up logrotate config files...
Backing up Apache config files...
Compressing backup...

===============
BACKUP COMPLETE
===============
Backup stored in /storage/home/hcodaman1/xibackup/nagiosxi.1744693501.tar.gz

Why am I getting a message that backup failed?

As an aside it would be helpful if backup logs included date time stamps (human readable, not epoch time). Also, any chance of having a running log, rather than log overwritten at each backup? Would be helpful in discerning differences in behavior/outcome between backups.

Thanks.

Re: Email that Backup failed, but log file shows it completed

Posted: Tue Apr 22, 2025 4:27 pm
by lgute
Hi @gregbeyer,

Thanks for reaching out.

I agree that human readable time stamps would be a nice change. I will add that request to our enhancement list. As well as the running log and maybe a choice between a running log and keeping a certain number of backup logs, with the same human readable date/time stamp in the name.

I will have to do some digging on the error message. What version of XI are you running, what distro/verion?

Re: Email that Backup failed, but log file shows it completed

Posted: Wed Apr 23, 2025 9:13 am
by tgriep
It looks like the backup is taking longer than 20 minutes to run and the timeout for the backup job needs to be increased.

At the bottom of this file on the Nagios server.

Code: Select all

/usr/local/nagiosxi/html/config.inc.php
put the following option.

Code: Select all

$cfg['backup_timeout'] = 3600;
Save the change and restart Apache and php-fpm and that will increase the timeout to 60 minutes. Run this to do that.

Code: Select all

systemctl restart httpd php-fpm
Then wait for the next run and see if the issue is resolved.

Re: Email that Backup failed, but log file shows it completed

Posted: Thu Apr 24, 2025 3:55 pm
by lgute
Hi @gregbeyer,

Your requests have been created and when implemented will be listed in the Changelog as...
  • [GL:XI#1838] Running and/or Rotating Backup Log Files
  • [GL:XI#1837] Backup File Names with Human Readable Date Format

Re: Email that Backup failed, but log file shows it completed

Posted: Thu May 01, 2025 8:42 am
by gregbeyer
Thank you, adding $cfg['backup_timeout'] = 3600; has fixed the problem.

Re: RESOLVED: Email that Backup failed, but log file shows it completed

Posted: Thu May 01, 2025 4:06 pm
by lgute
Hi @gregbeyer,

Thanks for the update. I am glad that resolved the problem.

I'm going to lock this thread.