VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   sometime I send same command to 200 host. helpme. (https://forums.vandyke.com/showthread.php?t=11233)

Junho 10-15-2013 04:50 PM

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~:p


[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()

bgagnon 10-16-2013 08:56 AM

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.


All times are GMT -6. The time now is 01:52 PM.