View Single Post
  #1  
Old 10-15-2013, 05:50 PM
Junho Junho is offline
Registered User
 
Join Date: Oct 2013
Posts: 4
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()
Reply With Quote