I have 47 Linux client machines and one Solaris server machine (all Linux client machines are red-hat 5.1)
all clients perform ssh connection to the server in order to verify if /tmp/generic_error.txt exist in the server
clients do the ssh exactly on 12:00 PM
I see something strange
Some of clients not recognized that /tmp/generic_error.txt exist in the server in spite this file was exist
So my first conclusion is that I can't perform multiple ssh from 47 machine to one server ?
But I don’t sure if I right ?
Please advice what the best process to perform ssh from 47 Linux clients to one server exactly on the same time?
remark - I can’t touch and configure the "ssh key-based authentication" because the Lenox’s machines must have password (part of our security policy)
- example of the expect script in the linux's clients - this expect verify if /tmp/generic_error.txt exists in the server (this action should be performed exactly on 12:00 PM on all 47 linux clients)
10.10.18.61 - server machine
expect=`cat << EOF
set timeout -1
spawn ssh 10.10.18.61
expect {
")?" { send "yes\r" ; exp_continue }
word: {send freenelsonmandela\r}
}
expect > {send "ls /tmp/generic_error.txt\r"}
expect > {send exit\r}
expect eof
EOF`
exe expect:
expect -c "$expect" | grep "generic_error.txt" | grep -v ls
If i understand correctly, you have 47 clients that need to know if some file exists on serverhost. And this needs to be run all at the same time.
Lets start with the smallest component, your file test. You can expand this some
This should work with most shells
Or BASH
You may want to check around more for the shell you are using, likely ksh, and double check its builtins for checking to see if a file is present.
Now slightly outwards, at the end of your expect, you are not doing anything with the results. this is likely the cause of most of your issue. you can access
$expect_out(buffer)
which will contain what ever was between the last matches.typically this is used as: