Remote Scheduled Backup overruled by Local Scheduled Backup

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dsynapalos
Posts: 23
Joined: Tue Jun 25, 2019 2:26 am

Remote Scheduled Backup overruled by Local Scheduled Backup

Post by dsynapalos »

Hello all,

We are having trouble with implementing a Remote Scheduled Backup for our XI installation.

We have tried both FTP and SSH schedules, both together and in turn.
For the FTP option we have tried passive mode and ssl option.
Test connection succeeds correctly and test upload transfers test file correctly.

When a schedule backup occurs, the backup is created locally and not transported to the configured host.
We have tried both disabling and leaving local backup enabled.

The backup created by the remote ftp and ssh schedules are visible in the local backups area of the gui and within the Nagios localhost in /store/backups/nagiosxi

We tried changing the local scheduled backup location to /store/backups/nagiosxi/test and the local backup was created correctly (within the test folder).
Having changed the local backup location, the remote ftp schedule still creates a backup within /store/backups/nagiosxi and fails to transporting to the remote host.

There are no firewalls intervening that would harm the transmission.

Any suggestions?
User avatar
tgriep
Madmin
Posts: 9179
Joined: Thu Oct 30, 2014 9:02 am

Re: Remote Scheduled Backup overruled by Local Scheduled Bac

Post by tgriep »

Follow this article to enable debugging for the scheduledbackups.log log file.
https://support.nagios.com/kb/article/n ... l-578.html

Schedule the backup to happen in 5 minutes and wait for 30 to 60 minutes and them get the full /usr/local/nagiosxi/var/components/scheduledbackups.log from the server sending the backup and add post it here.
That should show some sort of error.
Be sure to check out our Knowledgebase for helpful articles and solutions!
dsynapalos
Posts: 23
Joined: Tue Jun 25, 2019 2:26 am

Re: Remote Scheduled Backup overruled by Local Scheduled Bac

Post by dsynapalos »

Hello again,

according to the mentioned direcitons I changed 'SB_LOGLEVEL' to 0

Code: Select all

define('SB_LOGLEVEL', 0);
but the /usr/local/nagiosxi/var/components/scheduledbackups.log is not being filled with items. Last items are some errors that occurred at a past time before an upgrade and are now fixed. Nothing is being logged in the aforementioned file.

Tailing the /usr/local/nagiosxi/var/cmdsubsys.log I am receiving the following output:
tail /usr/local/nagiosxi/var/cmdsubsys.log -f
PROCESSING COMMAND ID 1959...
PROCESS COMMAND: CMD=1117, DATA=a:2:{i:0;s:19:"nagiosxi.1585816382";i:1;s:0:"";}
CMDLINE=sudo /usr/local/nagiosxi/scripts/backup_xi.sh -n nagiosxi.1585816382
No entry for terminal type "unknown";
using dumb terminal settings.
Backing up Nagios Core...
tar: Removing leading `/' from member names
.............tar: /usr/local/nagios/share/perfdata/HP-GR-CoreSW: file changed as we read it
PROCESSED 1 COMMANDS
..............tar: /usr/local/nagiosxi/var/eventman.log: file changed as we read it

.................

===============
BACKUP COMPLETE
===============
Backup stored in /store/backups/nagiosxi/nagiosxi.1585816382.tar.gz
OUTPUT=Backup stored in /store/backups/nagiosxi/nagiosxi.1585816382.tar.gz
RETURNCODE=0

PROCESSED 1 COMMANDS
................................................
After this point the nagiosxi.1585816382.tar.gz exists within the /store/backups/nagiosxi folder and has not been forwarded to the FTP server.
User avatar
tgriep
Madmin
Posts: 9179
Joined: Thu Oct 30, 2014 9:02 am

Re: Remote Scheduled Backup overruled by Local Scheduled Bac

Post by tgriep »

With the debug setting, you should of see this in the scheduledbackup.log file.
04-02-2020 13:16:02 DEBUG: Running scheduled SSH backup ...
04-02-2020 13:16:02 DEBUG: Sending create local backup command to CmdSubsystem

Do this, restart Apache

Code: Select all

service httpd restart
Go in to the XI GUI and make sure the scheduled backup is enabled.
Schedule it to run 5 minutes in the future and tail the log files again.

Code: Select all

tail -f /usr/local/nagiosxi/var/components/scheduledbackups.log /usr/local/nagiosxi/var/cmdsubsys.log
You should see it being scheduled.

What version of XI are you running?
Be sure to check out our Knowledgebase for helpful articles and solutions!
dsynapalos
Posts: 23
Joined: Tue Jun 25, 2019 2:26 am

Re: Remote Scheduled Backup overruled by Local Scheduled Bac

Post by dsynapalos »

Hello again,

I made sure SB_LOGLEVEL is defined correctly, restarted both apache and nagios and scheduled FTP and SSH backups at different times.
The /usr/local/nagiosxi/var/components/scheduledbackups.log remains empty while /usr/local/nagiosxi/var/cmdsubsys.log displays the output ran as previously.

Both transfer method schedules resulted in a completed LOCAL backup and neither was transported to the defined location. Please note that scheduled local backups are DISABLED.

As you can see I am running an up-to-date 5.6.12 version XI.
Untitled.png
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9179
Joined: Thu Oct 30, 2014 9:02 am

Re: Remote Scheduled Backup overruled by Local Scheduled Bac

Post by tgriep »

Do you see any errors on the remote system's logs that you are trying to send the backup to?

Lets set the permissions for files and folders for the log file.
Run the following as root.

Code: Select all

chown apache.nagios /usr/local/nagiosxi/var/components
chown apache.nagios /usr/local/nagiosxi/var/components/scheduledbackups.log
chmod 775 /usr/local/nagiosxi/var/components
chmod ug+s /usr/local/nagiosxi/var/components
chmos 664 /usr/local/nagiosxi/var/components/scheduledbackups.log
See if the log file is updated when the backup is ran.
Be sure to check out our Knowledgebase for helpful articles and solutions!
dsynapalos
Posts: 23
Joined: Tue Jun 25, 2019 2:26 am

Re: Remote Scheduled Backup overruled by Local Scheduled Bac

Post by dsynapalos »

Hello again,

changing the permissions fixed the logs, now we have an error:

[root@nagios ~]# tail -f /usr/local/nagiosxi/var/components/scheduledbackups.log
04-06-2020 11:00:03 DEBUG: Running scheduled FTP backup ...
04-06-2020 11:00:03 DEBUG: Sending create local backup command to CmdSubsystem
04-06-2020 11:20:07 ERROR: Scheduled FTP Backup Failed: Local file to transfer does not exist
This error occurred before the backup had finished (error at 11:20, backup completed at about 11:26).

Is the 20 min check defined somewhere? If the check occurred at 30 mins we would probably be fine.

[root@nagios ~]# tail -f /usr/local/nagiosxi/var/cmdsubsys.log
PROCESSED 0 COMMANDS
....PROCESSING COMMAND ID 1985...
PROCESS COMMAND: CMD=1119, DATA=a:2:{i:0;s:19:"nagiosxi.1586160003";i:1;s:24:"/store/backups/nagiosxi/";}
CMDLINE=rm -rf /store/backups/nagiosxi/nagiosxi.1586160003.tar.gz
OUTPUT=
RETURNCODE=0
.....................................tar: /usr/local/nagios/var/ndo.sock: socket ignored
....tar: /usr/local/nagios/var/nagios.log: file changed as we read it
tar: /usr/local/nagios/var: file changed as we read it
Copying ramdisk configuration...
Backing up Nagios XI...
.tar: Removing leading `/' from member names
Backing up nagios user home dir...
Backing up MySQL databases...
......................Backing up cronjobs for Apache...
Backing up logrotate config files...
Backing up Apache config files...
Compressing backup...
..........................
PROCESSED 0 COMMANDS
....................................................
PROCESSED 0 COMMANDS
.........................................
===============
BACKUP COMPLETE
===============
Backup stored in /store/backups/nagiosxi/nagiosxi.1586160003.tar.gz
OUTPUT=Backup stored in /store/backups/nagiosxi/nagiosxi.1586160003.tar.gz
RETURNCODE=0

tar: Removing leading `/' from member names
User avatar
tgriep
Madmin
Posts: 9179
Joined: Thu Oct 30, 2014 9:02 am

Re: Remote Scheduled Backup overruled by Local Scheduled Bac

Post by tgriep »

There is a way to increase the timeout for the scheduled backups.
Edit the /usr/local/nagiosxi/html/config.inc.php file and add the following option to the bottom.

Code: Select all

$cfg['backup_timeout'] = 3600;
Save it and restart Apache and that will increase the timeout to 60 minutes.
Be sure to check out our Knowledgebase for helpful articles and solutions!
dsynapalos
Posts: 23
Joined: Tue Jun 25, 2019 2:26 am

Re: Remote Scheduled Backup overruled by Local Scheduled Bac

Post by dsynapalos »

Hello again,

after configuring the time frame the remote backup schedule executes correctly and the backup appears at the FTP server.

This ticket may close, thank you for your expertise.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Remote Scheduled Backup overruled by Local Scheduled Bac

Post by scottwilkerson »

dsynapalos wrote:Hello again,

after configuring the time frame the remote backup schedule executes correctly and the backup appears at the FTP server.

This ticket may close, thank you for your expertise.
Great!

Locking thread
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked