Solved

UNIX-PUTTY-ALM/JIRA-AUTOMATION

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AWS EC2 HTTP & HTTPS 2 79
LogmeIn using Linux Ubuntu 16.04 6 117
PHP error function not working on AWS 10 129
Migrating a Linux server to VMware 3 112
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

730 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