Page 2 of 4
Re: SSH Scheduled Backups
Posted: Sun Nov 01, 2015 12:16 pm
by bosecorp
need to do it again, that day we happened to run out space.
my problem is that the zip file is not getting copied to the remote server. the backup finish completely and you can tell because the zip file is created successfully. in the example provided, that doesn't happens
Re: SSH Scheduled Backups
Posted: Sun Nov 01, 2015 9:44 pm
by Box293
Yes I can see a couple of things going on.
I noticed these errors in the log you PM'd me:
Code: Select all
Message: A database connection error has been detected, we are attempting to repair the server, if the repair does not resolve the issue, please contact Nagios support.
ERROR CONNECTING TO DATABASES!
PHP Warning: pg_pconnect(): Unable to connect to PostgreSQL server: FATAL: connection limit exceeded for non-superusers in /usr/local/nagiosxi/html/db/adodb/drivers/adodb-postgres64.inc.php on line 682
I'm going to follow up with the USA techs on this one. Regardless, I know this is not the cause of your issue but it needs to be resolved none the less.
What version of Nagios XI do you have?
I would also like you to attempt to copy the file vi SSH at the command line:
Code: Select all
su nagios
xxx command to copy /store/backups/nagiosxi/backupfile.tar.gz to SSH destination
I want to see if it succeeds at the command line.
Re: SSH Scheduled Backups
Posted: Mon Nov 02, 2015 2:07 pm
by tmcdonald
How many people do you have logged in at once? The pg_connect errors about connection limits exceeded is usually an easy fix, but typically only seen when many people are logged in at once or when many reports are being run:
http://stackoverflow.com/questions/1358 ... superusers
Also, do you have any checks being run against the Nagios postgres database for performance or anything? This would also add to the number of connections.
Re: SSH Scheduled Backups
Posted: Mon Nov 02, 2015 5:05 pm
by bosecorp
Box293
here is the result
# su - nagios
[nagios@nagmonus1 ~]$ cd /store/
[nagios@nagmonus1 store]$ cd backups/
[nagios@nagmonus1 backups]$ cd nagiosxi/
[nagios@nagmonus1 nagiosxi]$ scp nagiosxi.1446430802.tar.gz nagmondb1:/store/backups/nagiosxi
scp: /store/backups/nagiosxi/nagiosxi.1446430802.tar.gz: Permission denied
but, this should not matter because when I schedule the JOB, I configured as root
lastly, my DB seems to be in a good state
# /usr/local/nagiosxi/scripts/box293_check_mysql_table_status nagios nagiosxi
Database "nagios" = All OK
You have mail in /var/spool/mail/root
root@nagmondb1:(11-02 17:01): /
# /usr/local/nagiosxi/scripts/box293_check_mysql_table_status nagiosql nagiosxi
Database "nagiosql" = All OK
Re: SSH Scheduled Backups
Posted: Mon Nov 02, 2015 5:11 pm
by bosecorp
Hi tmcdonald
We have about ten different stations that have different dashboards
I do have checks being run agains the postgress db
Re: SSH Scheduled Backups
Posted: Mon Nov 02, 2015 5:16 pm
by Box293
bosecorp wrote:# su - nagios
[nagios@nagmonus1 ~]$ cd /store/
[nagios@nagmonus1 store]$ cd backups/
[nagios@nagmonus1 backups]$ cd nagiosxi/
[nagios@nagmonus1 nagiosxi]$ scp nagiosxi.1446430802.tar.gz nagmondb1:/store/backups/nagiosxi
scp: /store/backups/nagiosxi/nagiosxi.1446430802.tar.gz: Permission denied
but, this should not matter because when I schedule the JOB, I configured as root
OK so the cron job itself runs as the nagios user, lets try making sure we also define the root username:
Code: Select all
su - nagios
cd /store/backups/nagiosxi/
scp nagiosxi.1446430802.tar.gz root@nagmondb1:/store/backups/nagiosxi
It should prompt you for the password, please type it and lets see what the result is.
Re: SSH Scheduled Backups
Posted: Tue Nov 03, 2015 7:21 pm
by bosecorp
it works, after typing the password
root@nagmonus1:(11-03 19:19): /root/.ssh
# su - nagios
[nagios@nagmonus1 ~]$ cd /store/backups/nagiosxi/
[nagios@nagmonus1 nagiosxi]$ scp nagiosxi.1446430802.tar.gz root@nagmondb1:/store/backups/nagiosxi
root@nagmondb1's password:
nagiosxi.1446430802.tar.gz 100% 7826MB 49.9MB/s 02:37
You have new mail in /var/spool/mail/nagios
[nagios@nagmonus1 nagiosxi]$
Re: SSH Scheduled Backups
Posted: Tue Nov 03, 2015 9:34 pm
by Box293
OK so thats a good thing.
I'm going to talk to the USA techs about what troubleshooting steps we can follow next.
Re: SSH Scheduled Backups
Posted: Tue Nov 03, 2015 10:01 pm
by Box293
What version of XI are you using?
Re: SSH Scheduled Backups
Posted: Wed Nov 04, 2015 2:22 pm
by bosecorp
Installed Version: 2014R1.5