Solved

UNIX-PUTTY-ALM/JIRA-AUTOMATION

Posted on 2016-10-21
4
49 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 10

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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Fine Tune your automatic Updates for Ubuntu / Debian
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

636 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