Page 1 of 1

Scheduled SSH Backup Failed

Posted: Mon Apr 24, 2017 9:46 am
by onegative
G 'Day Nagios Support,

I am having issues with getting SSH Backups to work. Seems like the local backups work fine and a gzip file is created. But for the SSH Backup it seems like the actual file creation is not happening. Please find below the logging which records the error.

/usr/local/nagiosxi/var/components/scheduledbackups.log

04-21-2017 13:00:02 DEBUG: Running scheduled SSH backup ...
04-21-2017 13:00:02 DEBUG: Sending create local backup command to CmdSubsystem
04-21-2017 13:24:44 ERROR: Scheduled SSH Backup Failed: Local file to transfer does not exist

04-21-2017 19:35:02 DEBUG: Running scheduled local backup ...
04-21-2017 19:35:02 INFO: Creating a local backup: nagiosxi.1492828502
04-21-2017 19:35:02 DEBUG: Sending create local backup command to CmdSubsystem

04-22-2017 13:00:02 DEBUG: Running scheduled SSH backup ...
04-22-2017 13:00:02 DEBUG: Sending create local backup command to CmdSubsystem
04-22-2017 13:24:43 ERROR: Scheduled SSH Backup Failed: Local file to transfer does not exist

04-22-2017 19:35:02 DEBUG: Running scheduled local backup ...
04-22-2017 19:35:02 INFO: Creating a local backup: nagiosxi.1492914902
04-22-2017 19:35:02 DEBUG: Sending create local backup command to CmdSubsystem

04-23-2017 13:00:02 DEBUG: Running scheduled SSH backup ...
04-23-2017 13:00:02 DEBUG: Sending create local backup command to CmdSubsystem
04-23-2017 13:00:05 ERROR: Scheduled SSH Backup Failed: Local file to transfer does not exist

04-23-2017 19:35:02 DEBUG: Running scheduled local backup ...
04-23-2017 19:35:02 INFO: Creating a local backup: nagiosxi.1493001302
04-23-2017 19:35:02 DEBUG: Sending create local backup command to CmdSubsystem

04-24-2017 07:19:02 DEBUG: Running scheduled SSH backup ...
04-24-2017 07:19:02 DEBUG: Sending create local backup command to CmdSubsystem
04-24-2017 07:19:03 ERROR: Scheduled SSH Backup Failed: Local file to transfer does not exist


The connection to the remote host works and the Test SCP Transfer works fine.

I have added the following to config.inc.php just in case the backup with not completing but seeing its only 435M that seems unlikely.
// increase backup timeout
$cfg['backup_timeout'] = 3600;


From here you can see the SSH Backup is scheduled...

| 110 | scheduled_ssh_backups | a:13:{s:6:"active";i:1;s:4:"freq";s:5:"daily";s:3:"day";s:1:"0";s:5:"hours";s:2:"07";s:4:"mins";s:2:"19";s:6:"server";s:27:"REDACTED";s:4:"port";s:2:"22";s:8:"username";s:6:"REDACTED";s:8:"password";s:18:"REDACTED";
s:3:"dir";s:26:"/home/nagios/NagiosBackUp/";s:5:"limit";s:1:"5";s:7:"lastrun";i:1493043540;s:7:"nextrun";i:1493129940;}


Anyway can you suggest any other things to look at to determine why the SSH backup file is not being created?

One question I have is with regard to the remote target system's directory. I have it specified as /home/nagios/NagiosBackUp/ and I hope that does not mean the same directory should exist locally on the Nagios XI server, correct?

Please give me some ideas on what else I can check against.
Thanks,
Danny

Re: Scheduled SSH Backup Failed

Posted: Mon Apr 24, 2017 10:51 am
by onegative
After further review it does not appear that even the local backups are no working. So obviously I have a bigger problem than I first anticipated. I could sure use some support help in trying to understand why its not working. The documentation from the forum doesn't really explain much in terms of details.

Help please,
Danny

Re: Scheduled SSH Backup Failed

Posted: Mon Apr 24, 2017 11:45 am
by onegative
OK I believe I have found the issue...seems like the sudo entry '/usr/local/nagiosxi/scripts/backup_xi.sh' is/was missing and therefore the following was happening.

.PROCESSING COMMAND ID 4943...
PROCESS COMMAND: CMD=1117, DATA=
CMDLINE=sudo /usr/local/nagiosxi/scripts/backup_xi.sh
sudo: no tty present and no askpass program specified
OUTPUT=
RETURNCODE=1


Added the entry to the sudoers file and tested...its working.
This seems to be something that got removed from during one of the recent upgrades...or at least that is my assumption.

But its working now...and therefore no need to respond Support.

Thanks,
Danny