Solved

UNIX-PUTTY-ALM/JIRA-AUTOMATION

Posted on 2016-10-21
4
26 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 40

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

813 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

16 Experts available now in Live!

Get 1:1 Help Now