Solved

UNIX-PUTTY-ALM/JIRA-AUTOMATION

Posted on 2016-10-21
4
21 Views
Last Modified: 2016-11-17
I want  to develop a tool which would execute jobs in unix( may be putty)  with few parameters passed and return the logs. if it passes it would execute any test cases related to it in ALM/JIRA. what all tools/languages can i use? Any suggestion welcomed.
0
Comment
Question by:Ketty Shaw
  • 2
4 Comments
 
LVL 39

Expert Comment

by:noci
ID: 41854542
Jenkins? as test manager.... (with tooling) i get the feeling that would be double up in this case.
can you use a build tool like ant...  (which can also connect and remote execute tasks).

Then putty on windows is called ssh on all command line oriented systems.  (Short for secure shell).
so a ssh {node} {commandline}
is sufficient and all output is sent to the session you are logged in on.
And cygwin does also supply such an option for windows. (cygwin + openssh, and then also all kinds of nifty tools like grep git....)
1
 
LVL 23

Assisted Solution

by:David
David earned 250 total points (awarded by participants)
ID: 41856154
It's true that with putty or other secure shell protocols, your client can establish an interactive, remote shell session on a given host. In my experience, putty passes one and only one initial command to the host, Typically the session then relies on a host-based script to run the job steps.

The putty suite, however, includes plink, a command line interface from your client. An example for finding log files, taken from one source, http://the.earth.li/~sgtatham/putty/0.58/htmldoc/Chapter7.html: plink mysession grep /~fred/ /var/log/httpd/access.log > fredlog .

Does this make sense? Try it and see.

dvz
0
 
LVL 9

Accepted Solution

by:
Carlos Ijalba earned 250 total points (awarded by participants)
ID: 41865254
RUNNING REMOTE COMMANDS THROUGH SSH:

Executing remote commands:

ssh $HOST "uname -a"                        <-- execute cmd in remote server as actual user
ssh root@$HOST 'uname -a'                  <-- exectute cmd in remote server as root

Executing remote scripts:

ssh $HOST '/PATH/script.sh'                  <-- execute script in remote server
ssh $HOST 'bash -s' < local_script.sh      <-- execute local script in remote server
ssh $HOST 'echo "root pwd" | sudo -Sv && bash -s' < local_script.sh      <-- run a script as root using sudo

If Machine A is a Windows box, you can use Plink (part of PuTTY) with the -m parameter, and it will execute the local script on the remote server:

plink root@MachineB -m local_script.sh

If Machine A is a Unix-based system, you can use:

ssh root@MachineB 'bash -s' < local_script.sh
0
 
LVL 23

Expert Comment

by:David
ID: 41891147
Both contributors pointed to plink, with complimentary information. The asker may have expected more variety or participation. And, they may have wanted nice examples of processing job results / error codes. I believe the latter shouldn't be difficult to find in the EE knowledge base, with a short search. Carlos, nicely done.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now