SSH backup via GUI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
absarcompass
Posts: 182
Joined: Thu May 14, 2015 9:57 pm

SSH backup via GUI

Post by absarcompass »

Hi guys,
I have enable ssh backup from nagiosxi 5.5.7 web interface but it is not authenticating.
I can do ssh and scp from my nagiosxi command line which certainly means that there is no issue of connectivity and authentication
can you suggest what might be causing an issue here

cheers
You do not have the required permissions to view the files attached to this post.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: SSH backup via GUI

Post by npolovenko »

Hello, @absarcompass. Do you see any errors in the following log file?
/usr/local/nagiosxi/var/components/scheduledbackups.log
Also, click on the test authentication button a few times and then upload the /var/log/secure and /var/log/messages from the remote SCP server.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
absarcompass
Posts: 182
Joined: Thu May 14, 2015 9:57 pm

Re: SSH backup via GUI

Post by absarcompass »

Thanks
looks like schedule backup is either not logging or not finding anything worthy of logging
[root@nagiosxi components]# tail -f /usr/local/nagiosxi/var/components/scheduledbackups.log
09-22-2017 05:30:06 DEBUG: Running scheduled FTP backup ...
09-22-2017 05:30:06 DEBUG: Sending create local backup command to CmdSubsystem
09-29-2017 05:30:06 DEBUG: Running scheduled FTP backup ...
09-29-2017 05:30:06 DEBUG: Sending create local backup command to CmdSubsystem
10-06-2017 05:30:06 DEBUG: Running scheduled FTP backup ...
10-06-2017 05:30:06 DEBUG: Sending create local backup command to CmdSubsystem
10-13-2017 05:30:06 DEBUG: Running scheduled FTP backup ...
10-13-2017 05:30:06 DEBUG: Sending create local backup command to CmdSubsystem
10-20-2017 05:30:06 DEBUG: Running scheduled FTP backup ...
10-20-2017 05:30:06 DEBUG: Sending create local backup command to CmdSubsystem

in addition to that secure/auth log has the below with nothing in messages
(I have removed IP address from log)
Dec 17 09:25:23 sshd[975]: Received disconnect from x.x.x.x port 58531:11: PECL/ssh2 (http://pecl.php.net/packages/ssh2) [preauth]
Dec 17 09:25:23 sshd[975]: Disconnected from authenticating user nagiosxi x.x.x.x port 58531 [preauth]
Dec 17 09:25:23 sshd[977]: Received disconnect from x.x.x.x port 58532:11: PECL/ssh2 (http://pecl.php.net/packages/ssh2) [preauth]
Dec 17 09:25:23 sshd[977]: Disconnected from authenticating user nagiosxi x.x.x.x port 58532 [preauth]
Cheers!
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: SSH backup via GUI

Post by npolovenko »

@absarcompass, Does the login or password to the remote FTP server contain any special characters? If so please try temporarily changing the password to something simple with no special characters. Let me know if the authentication starts working.
Also, you tried to ssh/scp from the command line, right? Now please sign in as the nagios user and try the same commands again:
su - nagios
Finally, please update to the latest version of XI -> 5.5.8.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
absarcompass
Posts: 182
Joined: Thu May 14, 2015 9:57 pm

Re: SSH backup via GUI

Post by absarcompass »

Hi
it didn't work with even simpler password from web interface
ssh worked from user nagios to remote server,
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: SSH backup via GUI

Post by ssax »

Did you test like this?

Code: Select all

su - nagios
ssh [email protected]
Does it prompt you with this still or did it store it already?

Code: Select all

The authenticity of host '192.168.X.X (192.168.X.X)' can't be established.
ECDSA key fingerprint is SHA256:cak0s3xE/fYTjxTSyFROsMHvWAWUmmEd7IUr+HSE8iU.
ECDSA key fingerprint is MD5:22:13:2a:43:a6:11:44:57:ed:c4:c5:56:b7:41:87:64.
Are you sure you want to continue connecting (yes/no)?
absarcompass
Posts: 182
Joined: Thu May 14, 2015 9:57 pm

Re: SSH backup via GUI

Post by absarcompass »

Hi ssax,
it wasn't but now it is already saved
does web gui has a different user for apache or php? it should work if it is working from command line
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: SSH backup via GUI

Post by ssax »

Should run as apache user.

Are you using a DNS name for the hostname or an IP address? If you're using a hostname, please try using the IP address and see if that works.

Do you see any errors in /var/log/httpd/error_log or in /var/log/httpd/ssl_error_log on the XI server when you click the Test Connection button?

You can run this tail command and then hit the test button to see if anything is output:

Code: Select all

tail -F /var/log/httpd/error_log /var/log/httpd/ssl_error_log
absarcompass
Posts: 182
Joined: Thu May 14, 2015 9:57 pm

Re: SSH backup via GUI

Post by absarcompass »

Hi ssax,
No, the hostname is ip address
there are logs only in /var/log/httpd/error_log
==> /var/log/httpd/error_log <==
[Fri Dec 21 08:57:48 2018] [error] [client 192.168.222.253] PHP Warning: ssh2_auth_password(): Authentication failed for nagiosxi using password in /usr/local/nagiosxi/html/includes/components/scheduledbackups/ajaxcalls.php on line 0, referer: http://nagiosxi.compassnet.co.nz/nagios ... ackups.php
[Fri Dec 21 08:59:14 2018] [error] [client 192.168.222.253] PHP Warning: ssh2_auth_password(): Authentication failed for nagiosxi using password in /usr/local/nagiosxi/html/includes/components/scheduledbackups/ajaxcalls.php on line 0, referer: http://nagiosxi.compassnet.co.nz/nagios ... ackups.php
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
[Fri Dec 21 09:02:16 2018] [error] [client 192.168.222.253] PHP Warning: ssh2_auth_password(): Authentication failed for nagiosxi using password in /usr/local/nagiosxi/html/includes/components/scheduledbackups/ajaxcalls.php on line 0, referer: http://nagiosxi.compassnet.co.nz/nagios ... ackups.php
But the same username and password with same port is authenticating in remote server from command line,
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: SSH backup via GUI

Post by npolovenko »

@absarcompass, Please sign in to the ssh backup server and open the following file:
/etc/ssh/sshd_config
Let me know if PasswordAuthentication is set to yes or no.

Also, when you ran the ssh command from the command line, did it ask you for a password or no?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked