Solved

UNIX-PUTTY-ALM/JIRA-AUTOMATION

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

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…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:

911 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

25 Experts available now in Live!

Get 1:1 Help Now