Please help as I am having issue running "ssh2" command through "DSEXECUTE" on windows datastage sever. This is what i am trying to do.
I have to run a batch file on a target server and the command i am running from datastage is as follows.
BuildCmd = "ssh2 " : Target_IP_Parm: " -v '" : NT_COMMAND_Parm:"'"
example = ssh2 <TargetSever IP> -v c:\ss.bat
Call DSExecute("NT", BuildCmd , CmdOutput, CmdRetCode)
Call DSLogInfo(" *** CmdOutput contains :" : CmdOutput , "")
Call DSLogInfo(" *** CmdRetCode contains :" : CmdRetCode, "")
The above mentioned command in the datastage job is executing the batch file on the target server sucessfully through SSH2
The problem is that the output generated when the batch file is exected is not getting captured in "CmdOutput ". and throwing the error as below.
Authentication successful.
Could not run stdio
We need to capture the output of the batch file for error handling to make sure the batch file finished sucessfully on the target server.
The batch file on the target server does not return any success or failure code thus we cannot make sure the batch file finished successfully or not on the target server.
I also tried writing the output of the "ssh2" command to a file but got the same error.
I would appreciate if somebody can advise me on this issue or if somebody has come across the similar issue.
Problem Running SSH2 on Windows Datastage server
Moderators: chulett, rschirm, roy
Re: Problem Running SSH2 on Windows Datastage server
Not sure if I understand this correctly , you would like to submit a batch script on some remote WIN server (SERVER 2) through the DataStage Engine, again on a WIN box, which is on a different machine (SERVER 1)
Does the ssh2 command successfully initiate this batch script on SERVER 2 when submitted directly through the command line and NOT through the DataStage Engine on SERVER 1 ?
Does the ssh2 command successfully initiate this batch script on SERVER 2 when submitted directly through the command line and NOT through the DataStage Engine on SERVER 1 ?
Re: Problem Running SSH2 on Windows Datastage server
I am submitting the ssh2 from DataStage Engine which is on WIN box (SERVER 1) to different machine (SERVER 2) which is a WIN box as well.rohit1231 wrote:Not sure if I understand this correctly , you would like to submit a batch script on some remote WIN server (SERVER 2) through the DataStage Engine, again on a WIN box, which is on a different machine (SERVER 1)
Does the ssh2 command successfully initiate this batch script on SERVER 2 when submitted directly through the command line and NOT through the DataStage Engine on SERVER 1 ?
ssh2 command successfully initiate the batch script on SERVER 2 and generates and capture the output but through DataStage It does not capture the output but do generates the script on target server (SERVER2)
DJRH
Try using
Does the output look different? Is the length of CmdOutput greater than 0?
Code: Select all
EXECUTE 'DOS -c "':BuildCmd:'"' CAPTURING CmdOutput RETURNING CmdRetCode
Call DSLogInfo(" *** CmdOutput (":Len(CmdOutput):" chars) contains :" : CmdOutput , "")
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
ArndW wrote:Try usingDoes the output look different? Is the length of CmdOutput greater than 0?Code: Select all
EXECUTE 'DOS -c "':BuildCmd:'"' CAPTURING CmdOutput RETURNING CmdRetCode Call DSLogInfo(" *** CmdOutput (":Len(CmdOutput):" chars) contains :" : CmdOutput , "")
I tried the above code you sent and this is what i got, mentioned below
CmdOutput (127 chars) contains :Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
d:\programs\Ascential\DataStage\Projects\epmdev1>
The output is not what i want . The actual output is the content of batch file which get listed when the batch file is executed and that also has a string called "process completed sucessfully" and thats what i need to capture to make sure that the batch file on the target server finished successfully.
DJRH
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: