Page 1 of 1

SSH backups are failing

Posted: Mon Aug 26, 2019 8:22 am
by IT-OPS-SYS
[root@cvrmnagiosxi001 nagiosxi]# tail -f /usr/local/nagiosxi/var/components/scheduledbackups.log
08-22-2019 07:20:15 ERROR: Scheduled SSH Backup Failed: Local file to transfer does not exist
08-23-2019 07:20:17 ERROR: Scheduled SSH Backup Failed: Local file to transfer does not exist
08-24-2019 07:20:09 ERROR: Scheduled SSH Backup Failed: Local file to transfer does not exist

we are able to test connection and test SCP transfer and it worked fine without any issue.
Remote ssh server has disk space as well, port 22 is open.
/etc/sudoers , i see the backup line (/usr/local/nagiosxi/scripts/backup_xi.sh) included as well.
remote directory has below permissions:
drwxr-xr-x 2 nagios nagios 242 Aug 26 09:14 nagios_backups
remote server is ping-able and we are able to scp the file manually to the remote server
manually able to take the local backups

any help would be appreciated.

Re: SSH backups are failing

Posted: Mon Aug 26, 2019 11:51 am
by mbellerue
This is a little strange. Nagios shouldn't be keeping a local file after the backup process is complete, if you only have SSH backups enabled. Do you have Local Backups enabled as well? If so, are they set for the same time as the SSH Backups?

I'm wondering if we're running into a situation where the backup file isn't read by the time the script tries to SCP the file off the system. Can you modify the scheduled time of the SSH Backups by +5 minutes?

Re: SSH backups are failing

Posted: Mon Aug 26, 2019 12:33 pm
by mbellerue
Actually, I just noticed something that may be the issue. All of your backups are failing at 7:20AM + a handful of seconds. The backup timeout defaults to 20 minutes, so what's probably happening is the script responsible for making the backup file is timing out, and the script that's responsible for transferring it doesn't know that the previous script failed.

Let's go right to changing the backup timeout setting.

Use your favorite editor to edit the file /usr/local/nagiosxi/html/config.inc.php
Find an empty line in that file and add the following

Code: Select all

$cfg['backup_timeout'] = 1800
That increases the execution time from the default 20 minutes, to 30 minutes. You can increase this as much as you like, up to 60 minutes. If you need to go beyond 60 minutes, we will need to alter PHP's max execution time.

Re: SSH backups are failing

Posted: Tue Aug 27, 2019 9:15 am
by IT-OPS-SYS
there should be ; after the command like below
$cfg['backup_timeout'] = 1800 ;

made the changes and the issue got fixed.

Re: SSH backups are failing

Posted: Tue Aug 27, 2019 9:33 am
by mbellerue
Excellent catch, thank you! Also glad to hear it's working now. Closing thread.

Re: SSH backups are failing

Posted: Tue Aug 27, 2019 9:33 am
by scottwilkerson
IT-OPS-SYS wrote:there should be ; after the command like below
$cfg['backup_timeout'] = 1800 ;

made the changes and the issue got fixed.
That is correct and glad you caught it!

Locking thread