The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday noon (PST)
The community will be in read-only from Tuesday 11:59pm (PST) to Wednesday noon (PST)
Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with ksc_simple_respond in Red Hat Linux

SOLVED
Go to solution
Highlighted
Raj Ghimire
Occasional Visitor

Issues with ksc_simple_respond in Red Hat Linux

Does anyone know if there is something different we have to do to make "ksc_simple_respond" work in in Linux servers ?

We are running a Sudo command to copy file from one directory to another  but ksc_simple_respond keeps Failing. We are usign this command for file movement: which works wonderfully in SOLARIS severs but in Linux servers ksc_simple_respond keeps failing. 

 

I can log in manually to linux sever and run the same "sudo cp" command just fine but does not work when used through ITG.

 

=====

ksc_connect_dest_server
TEMPDIR=[PKG.ID]_[PKG.PKGL.SEQ]
BKUPDIR=backup/$TEMPDIR
cd /merctmp
cd $TEMPDIR
ksc_simple_respond "sudo cp -p [PKG.PKGL.P.P_FILENAME] [PKG.PKGL.P.TARGET_DIRECTORY][PKG.PKGL.P.P_FILENAME]" -hide "Password" "[DEST_ENV.ENV.SERVER_PASSWORD]"
sudo -k
cd /merctmp
rm -rf $TEMPDIR
ksc_exit

=========

 

AND,

when I try and Remove the ksc_simple_respond, I get    "No such file or directory" Error :-(

 

Since initial connection to the same server and checout from SVN works fine, not sure why the file copy is not working., especially when I can copy the file just fine using the same command when I try doign that manually.
Can anyone provide any suggestion ?

 

Thanks in advance !
-Raj

13 REPLIES
Celil
Esteemed Contributor

Re: Issues with ksc_simple_respond in Red Hat Linux

Hi Raj,

Did you test below code what it return ?
[PKG.PKGL.P.TARGET_DIRECTORY][PKG.PKGL.P.P_FILENAM​E]
may be it write something like this:
c:\asdfile.txt
Celil

IT Governance Professional
& PPM Solution Architect
Utkarsh_Mishra
Honored Contributor

Re: Issues with ksc_simple_respond in Red Hat Linux

Can you check the space between the tokens and verify that it is correct.

 

I had observed similar issue with FTP on HP-UX.

 

Also can try to execute command with resolved tokens i.e. command highlighted in execution logs.

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Raj Ghimire
Occasional Visitor

Re: Issues with ksc_simple_respond in Red Hat Linux

Hi Celil/Utkarsh,
Thanks for your responses.

Not sure what you meant by whether it is retruning "c:\as dfile.txt". I think commands are getting executed just fine as I am using similar command on my Solaris boxes without any issues. Here is a sample command that it is trying to run: as I can see in my logs.

I can run this command just fine from command line but when I try the same thing from package, I get the Error like below:

=====================
sent command:
[itgadmin@findpart00 31845_7]$ pwd; echo KSC_EXIT_STATUS $?
received echo:
pwd; echo KSC_EXIT_STATUS $?
/merctmp/31845_7
KSC_EXIT_STATUS 0


sent command:
[itgadmin@findpart00 31845_7]$ ls; echo KSC_EXIT_STATUS $?
received echo:
ls; echo KSC_EXIT_STATUS $?
FindPart.jar
KSC_EXIT_STATUS 0

[itgadmin@findpart00 31845_7]$

KSC Simple Respond

Source Command:Copy and Cleanup - Non-Oracle

sudo cp -p FindPart.jar /opt/jboss/server/jboss/deploy/jbos<_7]$ sudo cp -p FindPart.jar /opt/jboss/server/jboss/deploy/jboss-web.deployer/ROOT.war/FindPartjava.io.IOException: Disconnect
at com.kintana.core.net.ssh2.SSH2ShellSession.process(SSH2ShellSession.java:823)

Closing SSH2 Session
****
Waiting for command prompt
Caught Exception: java.io.IOException: Stream closed.
Stream closed.
KSC Simple Respond Command Failed

================================

 

AND,
when I try to copy the file to another Sub-directory wihth /merctmp (whichi is owned by itgadmin), I get error like this....


KSC Simple Respond

Source Command:Copy and Cleanup - Non-Oracle

sudo cp -p FindPart.jar /merctmp/svntest/FindPart.jar
SSH received unexpected message type 98 from remote host: SSH-2.0-OpenSSH_4.3
SSH received unexpected message type 98 from remote host: SSH-2.0-OpenSSH_4.3
SSH received unexpected message type 98 from remote host: SSH-2.0-OpenSSH_4.3
java.io.IOException: Disconnect

KSC Simple Respond Command Failed

 

 

But as I mentioned, I can manually SSH into the same server manually and run the same command to copy the file without any issues..

 

Appreciate any suggestion I can get...

Thanks.

-Raj

Jim Esler
Honored Contributor

Re: Issues with ksc_simple_respond in Red Hat Linux

We have seen issues like this on different flavors of UNIX because each one uses different capitalization or other minor variations (like inclusion of blanks) in the prompt strings. I do not have The Linux servers I have access to give a very different prompt for password for the sudo command. This could be your issue.

Raj Ghimire
Occasional Visitor

Re: Issues with ksc_simple_respond in Red Hat Linux

Thanks Jim.

We think its related to password promt as well as I am able to run Non-Sudo commands just fine...

But I have tried many combinations for sudo command, some with Support tech's suggestions as welll but No luck yet. :-(

 

These are only "Some" of the recent tries NONE of which works...

 

ksc_simple_respond "sudo - itgadmin cp -p [PKG.PKGL.P.P_FILENAME] [PKG.PKGL.P.TARGET_DIRECTORY][PKG.PKGL.P.P_FILENAME]" -hide "Password" "[DEST_ENV.ENV.SERVER_PASSWORD]"

 

ksc_simple_respond "sudo - itgadmin cp -p [PKG.PKGL.P.P_FILENAME] [PKG.PKGL.P.TARGET_DIRECTORY][PKG.PKGL.P.P_FILENAME]" "$" -hide "Password" "[DEST_ENV.ENV.SERVER_PASSWORD]"

 

ksc_simple_respond "sudo cp -p [PKG.PKGL.P.P_FILENAME] [PKG.PKGL.P.TARGET_DIRECTORY][PKG.PKGL.P.P_FILENAME]" -hide "Password" "[DEST_ENV.ENV.SERVER_PASSWORD]"

 

ksc_simple_respond "sudo cp -p [PKG.PKGL.P.P_FILENAME] [PKG.PKGL.P.TARGET_DIRECTORY][PKG.PKGL.P.P_FILENAME]" "$" -hide "Password" "[DEST_ENV.ENV.SERVER_PASSWORD]"

 

 

Even when we use

ksc_simple_response "su -l itgadmin" "$" "echo bla"        above one of the above listed commands as I was sugested by support I run into same password prompt issue ... :-(

 

Can anyone provide any suggestion here. Will Appreciate it..

 

Jim Esler
Honored Contributor

Re: Issues with ksc_simple_respond in Red Hat Linux

When you log into the server directly and enter a sudo command, what does the password prompt look like? Try substituting the last line of the prompt for "Password" on your ksc_simple_respond command.

Raj Ghimire
Occasional Visitor

Re: Issues with ksc_simple_respond in Red Hat Linux

Thanks Jim.

 

Here is the log for Manual SSH:

 

[itgadmin@olaxda-findpart00 31847_1]$ sudo -k
[itgadmin@olaxda-findpart00 31847_1]$ pwd
/merctmp/31847_1
[itgadmin@olaxda-findpart00 31847_1]$ ls
FindPart.jar  FindPart.jar.test
[itgadmin@olaxda-findpart00 31847_1]$ sudo cp -p FindPart.jar.test /opt/jboss/server/jboss/deploy/jboss-web.deployer/ROOT.war/FindPart.jar.test
[sudo] password for itgadmin:
[itgadmin@olaxda-findpart00 31847_1]$

 

 

================

 

In ITG Object:

 

This is what I get when using which is one of the "Many" suggestions from Supprort :-(

 

ksc_connect_dest_server

TEMPDIR=[PKG.ID]_[PKG.PKGL.SEQ]

BKUPDIR=backup/$TEMPDIR

cd /merctmp

cd $TEMPDIR

ksc_simple_respond "sudo su - itgadmin"

ksc_simple_respond "su - itgadmin" -hide "word:" "[DEST_ENV.ENV.SERVER_PASSWORD]"

ksc_simple_respond "cp -p [PKG.PKGL.P.P_FILENAME] [PKG.PKGL.P.TARGET_DIRECTORY][PKG.PKGL.P.P_FILENAME]"

sudo -k

cd /merctmp

rm -rf $TEMPDIR

ksc_exit

 

Error Log:

 

KSC Simple Respond

 

Source Command:Copy and Cleanup - Non-Oracle

 

Waiting for command prompt

sudo su - itgadmin

[sudo] password for itgadmin: Preparing for further command execution

Issuing test commands to test the readiness of the remote host to receive commands.

Sending command: echo KSC_EXIT_STATUS $? 1

waiting for something to read...

 

Sorry, try again.

[sudo] password for itgadmin: [sudo] password for itgadmin:

Sending command: echo KSC_EXIT_STATUS $? 2

waiting for something to read...

Sorry, try again.

[sudo] password for itgadmin: [sudo] password for itgadmin:

Sending command: echo KSC_EXIT_STATUS $? 3

waiting for something to read...

Sorry, try again.

sudo: 3 incorrect password attempts

[itgadmin@olaxda-findpart00 31847_1]$ [itgadmin@olaxda-findpart00 31847_1]$

Sending command: echo KSC_EXIT_STATUS $? 4

waiting for something to read...

echo KSC_EXIT_STATUS $? 4

KSC_EXIT_STATUS 1 4

[itgadmin@olaxda-findpart00 31847_1]$ [itgadmin@olaxda-findpart00 31847_1]$

Found exit code 1 for attempt 4.  (Expecting attempt 4.)

Exit status is 1.

 

 

Proceeding with command execution.

 

KSC Simple Respond Command Failed [Tue Jul 17 12:25:55 CDT 2012]

 

 

Aborting command execution.

Closing SSH2 Session

Errors occurred during command execution.

Raj Ghimire
Occasional Visitor

Re: Issues with ksc_simple_respond in Red Hat Linux

By the way, although in the log it says 3 incorrect password attempt. The passoword is correct becasue itgadmin logs into that same server and creates temp and backup directory before running that sudo command just fine and Env check passes as well. It seems somehow the password that is being provided in the sudo command is not getting passed :-(

Raj Ghimire
Occasional Visitor

Re: Issues with ksc_simple_respond in Red Hat Linux

And when I try,

ksc_simple_respond "sudo su - itgadmin" -hide "word:" "[DEST_ENV.ENV.SERVER_PASSWORD]" "$" "echo $"
ksc_simple_respond "cp -p [PKG.PKGL.P.P_FILENAME] [PKG.PKGL.P.TARGET_DIRECTORY][PKG.PKGL.P.P_FILENAME]"

 

I get the following Error:

KSC Simple Respond

Source Command:Copy and Cleanup - Non-Oracle

sudo su - itgadmin
SSH received unexpected message type 98 from remote host: SSH-2.0-OpenSSH_4.3
SSH received unexpected message type 98 from remote host: SSH-2.0-OpenSSH_4.3
SSH received unexpected message type 98 from remote host: SSH-2.0-OpenSSH_4.3
java.io.IOException: Disconnect

Jim Esler
Honored Contributor
Solution

Re: Issues with ksc_simple_respond in Red Hat Linux

Try this:

 

ksc_simple_respond "sudo cp -p [PKG.PKGL.P.P_FILENAME] [PKG.PKGL.P.TARGET_DIRECTORY][PKG.PKGL.P.P_FILENAME]" -hide "itgadmin:" "[DEST_ENV.ENV.SERVER_PASSWORD]"

Raj Ghimire
Occasional Visitor

Re: Issues with ksc_simple_respond in Red Hat Linux

Wow that worked .....This was troubling me for the last 3 days ..... You are The MAN Jim. 

Thank you soooo very much !!!!!

 

-Raj

Robert_Lundgren
Acclaimed Contributor

Re: Issues with ksc_simple_respond in Red Hat Linux

We also experienced this problem.

However after adding "$" "echo $" after ksc_simple_command we got the following error

 

SSH received unexpected message type 98 from remote host: SSH-2.0-OpenSSH_4.3

 

when the script was finished.

 

I our case we solved it with changing it to #$# #echo $#

 

/Robert

Subhac
Super Collector

Re: Issues with ksc_simple_respond in Red Hat Linux

Hi Robert,

 

We have tried using the option '#$# #echo $#'  after ksc_simple_Respond command as you suggested below and we set the Timeout parameter  to 7200 seconds. The given timeout parameter obeyed the timeout period.  After the 7200 seconds, the migration line failed with the message:   Failed [cmds timed out]

 

Attaching the failure log...Could you please help us out how we can get out of this issue? 

 

Thanks in Advance!!

//Add this to "OnDomLoad" event