How to Simulate parallel-ssh with variables ??


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to Simulate parallel-ssh with variables ??
# 1  
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
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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

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

7. 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

8. 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

9. 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
Login or Register to Ask a Question