Page 1 of 1

Unable to run SSH from DataStage 9.1 on Windows

Posted: Sun Dec 14, 2014 11:04 pm
by mehimadri
Hello Friends,

Our DataStage installation is on Windows 2008 Server R2 and our version is the IIS v9.1.2.0. Now I have developed some SSH scripts to remotely execute netezza scripts on the Linux Netezza Server since NZSQL tool does not have a Windows equivalent. The Shell script that is using the SSH commands are running fine when invoked from the command prompt. I have also setup SSH passwordless authentication for a OS USER that is mapped to a DataStage User.

However when I try to run the Script from a DataStage Job (either from a Sequence's execute command activity stage or from a parallel Job's before/after job routine) the Job successfully executes all other commands that are present in the Shell Script like creation of a directory and so on but while executing the SSH command the Job seems to hang as is evident from the director where we can see no further generation of logs but the Job seems to be running indefinitely (I manually killed the process after 24 hours of execution :)). The shell script when invoked takes less than 10 seconds to execute so this is definitely an issue.

Has anyone of you faced this issue and have managed to resolve it.

Many thanks in advance.

Posted: Mon Dec 15, 2014 2:13 am
by ArndW
This looks like a problem of authentication with a new user, where the script is waiting on a prompt that never gets filled by the process.
Are you manually running the script with the same userid that DataStage is using? My guess is that the answer might be "no", in which case you need to use the same user manually and get the SSH key authentication taken care of (one-time) and then the script should work thereafter.

Posted: Mon Dec 15, 2014 9:11 am
by mehimadri
Yes, I am using the same user to run the script manually and I have setup the passwordless authentication for the same user. I am using the same user when running the Jobs.

Posted: Mon Dec 15, 2014 10:40 am
by PaulVL
Add an echo statement to your script to print out the ssh command being executed. Maybe a parm is missing...

When you log in manually to the target server via ssh... do you get prompted for anything? Not password, but perhaps something in the target system .profile is messing you up.

Posted: Mon Dec 15, 2014 10:48 am
by mehimadri
No, I did not get prompted for anything when I login manually through the script. It is clean login.
And the ssh command that I execute is a pretty simple command that executes fine even if I take that out from the script and execute hat directly through my script.

ssh user@host "ls -l" >> command_output.log

Posted: Mon Dec 15, 2014 11:13 am
by PaulVL
Eek, not a big fan of writing to the project directory. Maybe add a full path to that command_output.log file.



What does the log file say?

Can you add a -d to your ssh command for extra debug info?

Posted: Mon Dec 22, 2014 3:05 am
by boolseye
We faced similar problm but for different db.
Just ask the db admins to monitor the session at db end as soon as that script is hit.
This looks like a problem with infrastructure