SSH Scheduled Backups failing

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
psanchez
Posts: 23
Joined: Wed Oct 17, 2012 12:14 pm

Re: SSH Scheduled Backups failing

Post by psanchez »

I corrected the permissions on scheduledbackups.log

Is there a way to get a copy of the updated "Scheduled Backups" component sooner, instead of waiting until next release?

I'll let the jobs run tonight and report tomorrow.


So are these two things possible or not?

... enable verbose/debug logging of schedule backup job?

... a way to force run a manual schedule backup job from command line without scheduling via web interface?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: SSH Scheduled Backups failing

Post by abrist »

psanchez wrote:... enable verbose/debug logging of schedule backup job?
No, just the current information reported is what can be reported.
psanchez wrote:... a way to force run a manual schedule backup job from command line without scheduling via web interface?
I do not believe so at this time as the php that does the backup source's in a number of other scripts and needs access to postgres. I will look into it though.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: SSH Scheduled Backups failing

Post by Box293 »

To perform a manual backup from the command line:

Code: Select all

su nagios
/usr/local/nagiosxi/scripts/backup_xi.sh testbackup -d /store/backups/nagiosxi/
Where testbackup is the name you want to give the backup.

However this will not do anything in relation to deleting older backups, it just does the backup.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
psanchez
Posts: 23
Joined: Wed Oct 17, 2012 12:14 pm

Re: SSH Scheduled Backups failing

Post by psanchez »

so after fixing the permissions on /usr/local/nagiosxi/var/components/scheduledbackups.log, it is now being updated:

09-30-2014 07:43:56 ERROR: Scheduled SSH Backup Failed: File was not transferred successfully
10-01-2014 07:43:53 ERROR: Scheduled SSH Backup Failed: File was not transferred successfully
10-08-2014 08:12:12 ERROR: Scheduled SSH Backup Failed: File was not transferred successfully

I'm still also getting this error on other servers: WARNING: Scheduled SSH Backup Error: Temporary file nagiosxi.1412777461 could not be deleted


Thanks @Box293, but a schedule backup seems to be a little different, as it needs to do SCP/FTP transfer also.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: SSH Scheduled Backups failing

Post by lmiltchev »

Run the following commands on the Nagios XI box and show us the output:

Code: Select all

ll -d /store/backups/nagiosxi/
ll /store/backups/nagiosxi/
yum list installed | grep ssh2
To upgrade the "Scheduled Backup" component:

1. Download the file below:
scheduledbackups.zip
2. Don't install it as you would install a regular component! It will error out. Unzip it and copy over all of the contents of the "scheduledbackups" directory to: "/usr/local/nagiosxi/html/includes/components/scheduledbackups/" directory, overwriting the original files. You can transfer files with FileZilla.

Important: Backup the original directory to a safe location first!

3. Go to Admin->Manage Components, and check the version of the "Scheduled Backups" component. It should be 1.0.6.

Let me know if using the new component solves your issue.
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
psanchez
Posts: 23
Joined: Wed Oct 17, 2012 12:14 pm

Re: SSH Scheduled Backups failing

Post by psanchez »

Thanks for the zip file, I'll let it run tonight and post results tomorrow.

I ran the commands on all our 3 nagios xi instances, you'll see some old backups that were created manually a while back.

rhel-x86_64-server-6 is our local yum server, mirroring RedHat.


Site A

Code: Select all

ll -d /store/backups/nagiosxi/

drwxrwxr-x 2 nagios nagios 4096 Oct  9 07:51 /store/backups/nagiosxi/

Code: Select all

ll /store/backups/nagiosxi/

total 2718272
-rw-r--r-- 1 nagios nagios 198932256 Aug 14 13:01 1408046305.tar.gz
-rw-r--r-- 1 nagios nagios 222077100 Oct  1 18:19 autoupgrade_backup..tar.gz
-rw-r--r-- 1 nagios nagios 221962647 Oct  1 14:04 BeforeUpgrade.tar.gz
-rw-r--r-- 1 nagios nagios 303967654 Oct  2 19:02 nagiosxi.1412301661.tar.gz
-rw-r--r-- 1 nagios nagios 304685526 Oct  3 19:02 nagiosxi.1412388061.tar.gz
-rw-r--r-- 1 nagios nagios 305234343 Oct  4 19:02 nagiosxi.1412474461.tar.gz
-rw-r--r-- 1 nagios nagios 305560085 Oct  5 19:02 nagiosxi.1412560861.tar.gz
-rw-r--r-- 1 nagios nagios 306196792 Oct  6 19:02 nagiosxi.1412647262.tar.gz
-rw-r--r-- 1 nagios nagios 307067869 Oct  7 19:02 nagiosxi.1412733661.tar.gz
-rw-r--r-- 1 nagios nagios 307759838 Oct  8 19:02 nagiosxi.1412820062.tar.gz

Code: Select all

yum list installed | grep ssh2

libssh2.x86_64                    1.2.2-11.el6_3           @rhel-x86_64-server-6
php-pecl-ssh2.x86_64              0.11.0-7.el6             @epel                

Site B

Code: Select all

ll -d /store/backups/nagiosxi/
drwxrwxr-x 2 nagios nagios 4096 Oct  9 08:01 /store/backups/nagiosxi/

Code: Select all

ll /store/backups/nagiosxi/

total 4824920
-rw-r--r-- 1 nagios nagios 404482724 Aug 14 13:08 1408046306.tar.gz
-rw-r--r-- 1 nagios nagios 440438321 Oct  1 18:17 autoupgrade_backup..tar.gz
-rw-r--r-- 1 nagios nagios 440368589 Oct  1 14:07 BeforeUpgrade.tar.gz
-rw-r--r-- 1 nagios nagios 522106732 Oct  2 19:14 nagiosxi.1412302261.tar.gz
-rw-r--r-- 1 nagios nagios 521999862 Oct  3 19:14 nagiosxi.1412388661.tar.gz
-rw-r--r-- 1 nagios nagios 521327579 Oct  4 19:15 nagiosxi.1412475061.tar.gz
-rw-r--r-- 1 nagios nagios 521708998 Oct  5 19:14 nagiosxi.1412561461.tar.gz
-rw-r--r-- 1 nagios nagios 521956350 Oct  6 19:15 nagiosxi.1412647861.tar.gz
-rw-r--r-- 1 nagios nagios 522843699 Oct  7 19:14 nagiosxi.1412734261.tar.gz
-rw-r--r-- 1 nagios nagios 523419364 Oct  8 19:14 nagiosxi.1412820661.tar.gz

Code: Select all

yum list installed | grep ssh2

libssh2.x86_64                    1.4.2-1.el6              @rhel-x86_64-server-6
php-pecl-ssh2.x86_64              0.11.0-7.el6             @epel                

Site C

Code: Select all

ll -d /store/backups/nagiosxi/
drwxrwxr-x 2 nagios nagios 4096 Oct  9 08:12 /store/backups/nagiosxi/

Code: Select all

ll /store/backups/nagiosxi/

total 2033264
-rw-r--r-- 1 nagios nagios  28948139 Feb 15  2013 1360974821.tar.gz
-rw-r--r-- 1 nagios nagios  33202955 May 21  2013 1369178664.tar.gz
-rw-r--r-- 1 nagios nagios  98761326 Aug 14 16:02 1408046306.tar.gz
-rw-r--r-- 1 nagios nagios 116739569 Sep  4 15:22 1409858515.tar.gz
-rw-r--r-- 1 nagios nagios 134940270 Oct  1 21:09 autoupgrade_backup..tar.gz
-rw-r--r-- 1 nagios nagios 134802903 Oct  1 17:03 BeforeUpgrade.tar.gz
-rw-r--r-- 1 nagios nagios 216849514 Oct  2 19:22 nagiosxi.1412292062.tar.gz
-rw-r--r-- 1 nagios nagios 217616888 Oct  3 19:22 nagiosxi.1412378462.tar.gz
-rw-r--r-- 1 nagios nagios 218321633 Oct  4 19:22 nagiosxi.1412464862.tar.gz
-rw-r--r-- 1 nagios nagios 219054694 Oct  5 19:22 nagiosxi.1412551263.tar.gz
-rw-r--r-- 1 nagios nagios 220031512 Oct  6 19:22 nagiosxi.1412637662.tar.gz
-rw-r--r-- 1 nagios nagios 220914962 Oct  7 19:22 nagiosxi.1412724062.tar.gz
-rw-r--r-- 1 nagios nagios 221820185 Oct  8 19:22 nagiosxi.1412810462.tar.gz

Code: Select all

yum list installed | grep ssh2

libssh2.x86_64                     1.4.2-1.el6             @rhel-x86_64-server-6
php-pecl-ssh2.x86_64               0.11.0-7.el6            @epel          
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: SSH Scheduled Backups failing

Post by abrist »

psanchez wrote:Thanks for the zip file, I'll let it run tonight and post results tomorrow.
Great. We await your results.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
psanchez
Posts: 23
Joined: Wed Oct 17, 2012 12:14 pm

Re: SSH Scheduled Backups failing

Post by psanchez »

I installed the new files, but issue still persist on one of the 3 sites...and logging does not provide useful details.

Anything else i can try?

Code: Select all

10-10-2014 07:22:11 ERROR: Scheduled SSH Backup Failed: File was not transferred successfully

This is how i installed new files;

Before

Code: Select all

Scheduled Backups
Provides the ability to schedule full Nagios XI backups.
Version: 1.0.5 Author: Nagios Enterprises, LLC 

Code: Select all

cd /usr/local/nagiosxi/html/includes/components

tar zcvf scheduledbackups.backup.1.0.5.tar.gz scheduledbackups
cp -a scheduledbackups scheduledbackups-1.0.5 

unzip /tmp/scheduledbackups.zip
chown -R nagios:nagios scheduledbackups
chmod +x scheduledbackups/runlocalbackup.php

After

Code: Select all

Scheduled Backups
Provides the ability to schedule full Nagios XI backups.
Version: 1.0.6 Author: Nagios Enterprises, LLC 
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: SSH Scheduled Backups failing

Post by lmiltchev »

Can you show us the permissions of all of the items in the "scheduledbackups" directory?

Code: Select all

ls -la /usr/local/nagiosxi/html/includes/components/scheduledbackups/
Be sure to check out our Knowledgebase for helpful articles and solutions!
psanchez
Posts: 23
Joined: Wed Oct 17, 2012 12:14 pm

Re: SSH Scheduled Backups failing

Post by psanchez »

ls -la /usr/local/nagiosxi/html/includes/components/scheduledbackups/

total 296
drwxr-x--- 4 nagios nagios 4096 Oct 9 15:45 .
drwxr-x--- 60 nagios nagios 4096 Oct 9 15:45 ..
-rw-r--r-- 1 nagios nagios 5044 Jul 15 10:27 ajaxcalls.php
-rw-r--r-- 1 nagios nagios 918 Oct 7 14:43 CHANGES.txt
drwxr-x--- 2 nagios nagios 4096 Oct 9 15:45 images
drwxr-x--- 2 nagios nagios 4096 Oct 9 15:45 includes
-rw-r--r-- 1 nagios nagios 202 Jun 17 13:57 install.sh
-rw-r--r-- 1 nagios nagios 61216 Oct 7 14:51 localbackups.php
-rw-r--r-- 1 nagios nagios 102988 Oct 7 14:51 managebackups.php
-rwxr-xr-x 1 nagios nagios 281 Jul 15 10:27 runlocalbackup.php
-rw-r--r-- 1 nagios nagios 94956 Oct 7 14:51 scheduledbackups.inc.php
Locked