Skip to content
Permalink
Browse files

7932 FIX check_sftp: support for custom ports for SFTP

Custom port parameter is now used to connect to SFTP server.

Change-Id: I945f4c374e81ceadae9d3d0a907c08df36466042
  • Loading branch information...
Jonas Kluger
Jonas Kluger committed Aug 19, 2019
1 parent 5a77a25 commit 87f7d3e871f59ccec2b3de4cf57bbfb488c87dd2
Showing with 20 additions and 2 deletions.
  1. +10 −0 .werks/7932
  2. +10 −2 active_checks/check_sftp
@@ -0,0 +1,10 @@
Title: check_sftp: support for custom ports for SFTP
Level: 1
Component: checks
Compatible: compat
Edition: cre
Version: 1.7.0i1
Date: 1566201381
Class: fix

Custom port parameter is now used to connect to SFTP server.
@@ -125,9 +125,17 @@ def connection():
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
if opt_key is None:
client.connect(opt_host, username=opt_user, password=opt_pass, timeout=opt_timeout)
client.connect(opt_host,
username=opt_user,
password=opt_pass,
port=opt_port,
timeout=opt_timeout)
else:
client.connect(opt_host, username=opt_user, pkey=opt_key, timeout=opt_timeout)
client.connect(opt_host,
username=opt_user,
pkey=opt_key,
port=opt_port,
timeout=opt_timeout)
return client


0 comments on commit 87f7d3e

Please sign in to comment.
You can’t perform that action at this time.