SSH backups are failing

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
IT-OPS-SYS
Posts: 184
Joined: Sun Jan 07, 2018 12:56 pm

SSH backups are failing

Post 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.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: SSH backups are failing

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: SSH backups are failing

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
IT-OPS-SYS
Posts: 184
Joined: Sun Jan 07, 2018 12:56 pm

Re: SSH backups are failing

Post by IT-OPS-SYS »

there should be ; after the command like below
$cfg['backup_timeout'] = 1800 ;

made the changes and the issue got fixed.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: SSH backups are failing

Post by mbellerue »

Excellent catch, thank you! Also glad to hear it's working now. Closing thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: SSH backups are failing

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked