#1
|
|||
|
|||
sometime I send same command to 200 host. helpme.
I manage 200 Linux Redhat Servers.
Sometimes, I send same command to all host. This script is my shell. But my shell is too long and hard to modify... My wish is... - more simple and short shell - Can managed host to seperate section Help me. Thank you, very,very much~ ![]() [Before] # $language = "python" # $interface = "1.0" # This automatically generated script may need to be # edited in order to work correctly. def dooo (): crt.Screen.WaitForString("s password: ") crt.Screen.Send("!xxxxxppp" + chr(13)) crt.Screen.WaitForString(chr(126) + "]$ ") crt.Screen.Send("ifconfig -a" + chr(13)) crt.Screen.WaitForString(chr(126) + "]$ ") crt.Screen.Send("su" + chr(13)) crt.Screen.WaitForString("Password: ") crt.Screen.Send("xxxxxppp" + chr(13)) crt.Screen.WaitForString("]# ") crt.Screen.Send("ifconfig -a" + chr(13)) crt.Screen.WaitForString("]# ") crt.Screen.Send("exit" + chr(13)) crt.Screen.WaitForString(chr(126) + "]$ ") crt.Screen.Send("exit" + chr(13)) crt.Screen.WaitForString(chr(126) + "]$ ") crt.Screen.Send(chr(13)) def Main(): crt.Screen.Send("date" + chr(13)) crt.Screen.WaitForString(chr(126) + "]$ ") crt.Screen.Send("ssh -p 2022 xxxxx@10.ooo.ooo.101" + chr(13)) dooo() crt.Screen.Send("ssh -p 2022 xxxxx@10.ooo.ooo.102" + chr(13)) dooo() ... ... ... crt.Screen.Send("ssh -p 2022 xxxxx@10.ooo.ooo.198" + chr(13)) dooo() crt.Screen.Send("ssh -p 2022 xxxxx@10.ooo.ooo.199" + chr(13)) dooo() Main() |
#2
|
|||
|
|||
Hello Junho,
I am not really sure what you are trying to accomplish. Do you have a text file that contains the hostnames/IP addresses? If so, I think the example script available here might be better suited to the task.
__________________
Thanks, --Brenda VanDyke Software Technical Support support@vandyke.com (505) 332-5730 |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|