Unable to run SSH from DataStage 9.1 on Windows

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
mehimadri
Premium Member
Premium Member
Posts: 25
Joined: Sat Jan 13, 2007 4:56 am
Location: United States

Unable to run SSH from DataStage 9.1 on Windows

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
mehimadri
Premium Member
Premium Member
Posts: 25
Joined: Sat Jan 13, 2007 4:56 am
Location: United States

Post 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.
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post 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.
mehimadri
Premium Member
Premium Member
Posts: 25
Joined: Sat Jan 13, 2007 4:56 am
Location: United States

Post 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
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post 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?
boolseye
Participant
Posts: 18
Joined: Mon Jul 15, 2013 4:01 am

Post 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
-----------------
Thanks
Post Reply