TI for placing a file on SFTP server

Post Reply
amit_hhh
Posts: 28
Joined: Wed Jan 18, 2017 3:27 pm
OLAP Product: Cognos TM1
Version: 10.2.2, 11
Excel Version: Excel2010
Location: Bangalore, India

TI for placing a file on SFTP server

Post by amit_hhh »

Hi All,

I am trying to create a TI which will place a text file from data directory to an external SFTP server to be used by Database team. The database team has provided the host name, port number, file protocol(SFTP), userid/pwd to connect to the location to place the file. Can someone please guide me how should I write the TI? I am not looking for exact code but if someone can suggest some approach and functions, then It will be of great help. The files might need to be placed using batch files I guess. This is the first time I got such request in my project, so not sure how to achieve this. Thanks!!!
Regards,
Amit Saxena
India
ascheevel
Community Contributor
Posts: 286
Joined: Fri Feb 15, 2013 5:49 pm
OLAP Product: TM1
Version: PA 2.0.9.1
Excel Version: 365
Location: Minneapolis, USA

Re: TI for placing a file on SFTP server

Post by ascheevel »

You could use a tool like WinSCP to do the transfer. You can write a script for that program that can be called from a TI process in the same way that you'd call a .bat file.
User avatar
macsir
MVP
Posts: 782
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: TI for placing a file on SFTP server

Post by macsir »

I would recommend to use Powershell to call winSCP.
https://stackoverflow.com/questions/387 ... powershell
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
amit_hhh
Posts: 28
Joined: Wed Jan 18, 2017 3:27 pm
OLAP Product: Cognos TM1
Version: 10.2.2, 11
Excel Version: Excel2010
Location: Bangalore, India

Re: TI for placing a file on SFTP server

Post by amit_hhh »

ascheevel wrote: Tue May 29, 2018 6:18 am You could use a tool like WinSCP to do the transfer. You can write a script for that program that can be called from a TI process in the same way that you'd call a .bat file.
I created the below batch file and executed it through TI.
*********************
@ECHO On
set _datetime=%date%_%time%
set sftpascii=%1
set sftplog="E:\DataDirectory\log.txt"
echo ------------------------------------------------------- >> %sftplog%
echo %_datetime% >> %sftplog%
echo sending %sftpascii% >> %sftplog%
"C:\Program Files (x86)\Bitvise SSH Client\sftpc.exe" Username:Password@ServerHostName:22027 -pk=g1 -cmdfile=%sftpascii% >> %sftplog%
echo ------------------------------------------------------- >> %sftplog%
********************
Here sftpascii is the text file being passed in ExecuteCommand function in TI which has below code:

cd /Recon/
put -o "E:\cognos\FilePath\RECON_20180611233832.csv"
chmod 666 RECON_20180611233832.csv"
quit

but the below error is thrown in sftplog while executing the TI:
---------------------------------------
Fri 06/15/2018_ 3:23:57.02
sending "E:\cognos\FilePath\RECON_20180611233832.csv"
Bitvise SSH Client 7.31 - sftpc - free of charge for use in all environments
Copyright (C) 2000-2017 by Bitvise Limited.

Connecting to SSH2 server ServerHostName:22027.
Connection established.
Server version: SSH-2.0-1.82_sshlib TargetServerName
First key exchange started. Cryptographic provider: Windows CNG (x86) with additions
ERROR: The SSH2 session has terminated with error. Reason: Error class: LocalSshDisconn, code: KeyExchangeFailed, message: FlowSshTransport: no mutually supported inbound encryption algorithm. Local list: aes256-gcm,aes256-ctr,aes192-ctr,aes128-gcm,aes128-ctr,3des-ctr. Remote list: twofish256-cbc,aes256-cbc,twofish-cbc,3des-cbc,twofish128-cbc,aes128-cbc,cast128-cbc,blowfish-cbc,arcfour.
-------------------------------------

How can I resolve this error?
Regards,
Amit Saxena
India
User avatar
macsir
MVP
Posts: 782
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: TI for placing a file on SFTP server

Post by macsir »

google is your friend. https://serverfault.com/questions/78557 ... th-cuteftp
If you can't fix it, you still could try winscp.
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
Post Reply