Sponsored Content
Top Forums Shell Programming and Scripting How to Simulate parallel-ssh with variables ?? Post 302960999 by lohith.dutta on Monday 23rd of November 2015 02:17:43 AM
Old 11-23-2015
How to Simulate parallel-ssh with variables ??

Code:
alias n-001='ssh hst-net-001'
alias n-002='ssh hst-net-002'
alias n-003='ssh hst-net-003'
alias n-004='ssh hst-net-004'

alias p-001='ssh hst-proxy-001'
alias p-002='ssh hst-proxy-002'
alias p-003='ssh hst-proxy-003'
alias p-004='ssh hst-proxy-004'

------------------------------------------------------------------------------------
root@hst-mgmt-001:~# pn-xxx "hostname;uptime"
Code:
[1] 07:01:30 [SUCCESS] hst-net-004
hst-net-004
 07:01:30 up 341 days, 11:46,  0 users,  load average: 0.45, 0.28, 0.22
[2] 07:01:30 [SUCCESS] hst-net-001
hst-net-001
 07:01:30 up 341 days, 12:43,  0 users,  load average: 0.63, 0.52, 0.44
[3] 07:01:30 [SUCCESS] hst-net-002
hst-net-002
 07:01:30 up 341 days, 12:25,  0 users,  load average: 0.30, 0.32, 0.29
[4] 07:01:30 [SUCCESS] hst-net-003
hst-net-003
 07:01:30 up 341 days, 12:11,  0 users,  load average: 0.38, 0.29, 0.25

root@hst-mgmt-001:~# pp-xxx "hostname;uptime"
Code:
[1] 07:04:05 [SUCCESS] hst-proxy-001
hst-proxy-001
 07:04:05 up 527 days, 12:52,  0 users,  load average: 0.33, 0.34, 0.28
[2] 07:04:05 [SUCCESS] hst-proxy-002
hst-proxy-002
 07:04:05 up 527 days, 12:30,  0 users,  load average: 0.00, 0.01, 0.05
[3] 07:04:05 [SUCCESS] hst-proxy-003
hst-proxy-003
 07:04:05 up 520 days, 10:29,  0 users,  load average: 0.03, 0.04, 0.05
[4] 07:04:05 [SUCCESS] hst-proxy-004
hst-proxy-004
 07:04:05 up 520 days,  9:51,  0 users,  load average: 0.00, 0.01, 0.05

------------------------------------------------------------------------------------


The above outputs are from one of my Production box. I would like to understand here how the 'parallel-ssh' is extracting values from 'xxx' ??

Last edited by Franklin52; 11-23-2015 at 10:42 AM.. Reason: Adding code tags
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using variables in SSH

Please tell me what is wrong in the following shell script. #!/bin/sh DATE1=`date -d "yesterday" +"%Y-%m-%d"` ssh ftwplapp01 << EOF echo "Date is :" $DATE1 > /tmp/testfile cd /app/was6/AppServer/logs/prod_ebp_live/ebp tar cvf /app/was6/AppServer/logs/prod_ebp_live_applogs_$DATE1.tar `find... (1 Reply)
Discussion started by: tsryn
1 Replies

2. Shell Programming and Scripting

variables inside an ssh session

Hello all, I would like to declare and use variables inside an ssh session. I have the feeling that it's not possible. Here is the situtation simpified: #:/bin/sh test="salut" echo $test ssh hudson@10.41.21.99 <<EOF export testssh="salut" echo testssh=$testssh ... (4 Replies)
Discussion started by: Lotfus
4 Replies

3. Programming

Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX

Writing a Tool to simulate non-sequential disk I/O (simulate db file sequential read) in C POSIX I have over the years come across the same issue a couple of times, and it normally is that the read speed on SAN is absolutely atrocious when doing non-sequential I/O to the disks. Problem being of... (7 Replies)
Discussion started by: vrghost
7 Replies

4. Shell Programming and Scripting

Run recursive function with variables over SSH

Hi, I don't know if you can help or if this is even possible, but I am trying to run the following function over an ssh and (depending on the itteration I choose) keep getting unexpected token or undefined symbol errors. The function is: killtree() { typeset parent=$1 typeset child... (1 Reply)
Discussion started by: RECrerar
1 Replies

5. UNIX for Dummies Questions & Answers

Need to test 100 ssh connections in parallel using loop and sleep? How to do that ?

Hello All, I want to test how much parallel ssh connections can be done on a server. I am thinking of reading username and hostname from a file and then using a loop (may be for) to do ssh on different host. Could anyone suggest me how can i write the script for the above. Thank you in... (0 Replies)
Discussion started by: ABHIKORIA
0 Replies

6. Shell Programming and Scripting

ksh script to test max number of parallel ssh connections

hello , I need to check how many parallel ssh connections my server can take the load of. I need to login to different host which i am planning to read from a file and then a write a loop which will do parallel ssh. Please provide suggestion on how i can write script for the same.\ Thank... (1 Reply)
Discussion started by: ABHIKORIA
1 Replies

7. Shell Programming and Scripting

Using a find command in ssh but using local variables?

I have a script like this (Yes, I know the DAY6 number isn't right - I'm just testing at this point): DAY0=`date -I` DAY1=`date -I -d "1 day ago"` DAY6=`date -I -d "2 days ago"` if then ssh root@synology1 nohup rm -rf "/volume1/Fileserver/$DAY6" fi I've tested the line to remove the... (5 Replies)
Discussion started by: Orionizer
5 Replies

8. Shell Programming and Scripting

ksh - keep argument variables after ssh

i have a script that should ssh to different host/server. See below: ./script.ksh var1 var2 var3 case $ser in ser1) depo='appr1' set -A aprrA aprrB ssh ser2 "/home/dir/script.ksh $1 $2 $3" ssh ser3 "/home/dir/script.ksh $1 $2 $3" ssh ser4... (4 Replies)
Discussion started by: erin00
4 Replies

9. Shell Programming and Scripting

Read several variables from command output via SSH

Hi Folks, I'm currently trying to read several values into different variables. Actually, what I'm doing works, but I get an error message. My attempts are: read strCPROC strIPROC strAPROC <<<$(ssh -n -T hscroot@$HMC "lshwres -r proc -m $strIDENT --level sys -F \"configurable_sys_proc_units... (11 Replies)
Discussion started by: NKaede
11 Replies
SSH-KEYSIGN(8)						    BSD System Manager's Manual 					    SSH-KEYSIGN(8)

NAME
ssh-keysign -- ssh helper program for host-based authentication SYNOPSIS
ssh-keysign DESCRIPTION
ssh-keysign is used by ssh(1) to access the local host keys and generate the digital signature required during host-based authentication with SSH protocol version 2. ssh-keysign is disabled by default and can only be enabled in the global client configuration file /etc/ssh/ssh_config by setting EnableSSHKeysign to ``yes''. ssh-keysign is not intended to be invoked by the user, but from ssh(1). See ssh(1) and sshd(8) for more information about host-based authen- tication. FILES
/etc/ssh/ssh_config Controls whether ssh-keysign is enabled. /etc/ssh/ssh_host_dsa_key /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_rsa_key These files contain the private parts of the host keys used to generate the digital signature. They should be owned by root, read- able only by root, and not accessible to others. Since they are readable only by root, ssh-keysign must be set-uid root if host- based authentication is used. /etc/ssh/ssh_host_dsa_key-cert.pub /etc/ssh/ssh_host_ecdsa_key-cert.pub /etc/ssh/ssh_host_rsa_key-cert.pub If these files exist they are assumed to contain public certificate information corresponding with the private keys above. SEE ALSO
ssh(1), ssh-keygen(1), ssh_config(5), sshd(8) HISTORY
ssh-keysign first appeared in OpenBSD 3.2. AUTHORS
Markus Friedl <markus@openbsd.org> BSD
August 31, 2010 BSD
All times are GMT -4. The time now is 07:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy