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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gregbeyer
Posts: 181
Joined: Fri Sep 11, 2020 2:13 pm

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

Post 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.
Last edited by gregbeyer on Thu May 01, 2025 8:42 am, edited 1 time in total.
User avatar
lgute
Posts: 410
Joined: Mon Apr 06, 2020 2:49 pm

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

Post 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?
Please let us know if you have any other questions or concerns.

-Laura
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

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

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lgute
Posts: 410
Joined: Mon Apr 06, 2020 2:49 pm

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

Post 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
Please let us know if you have any other questions or concerns.

-Laura
gregbeyer
Posts: 181
Joined: Fri Sep 11, 2020 2:13 pm

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

Post by gregbeyer »

Thank you, adding $cfg['backup_timeout'] = 3600; has fixed the problem.
User avatar
lgute
Posts: 410
Joined: Mon Apr 06, 2020 2:49 pm

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

Post by lgute »

Hi @gregbeyer,

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

I'm going to lock this thread.
Please let us know if you have any other questions or concerns.

-Laura
Locked