Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-15-2013, 04: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
  #2  
Old 10-16-2013, 08:56 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
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
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 07:49 PM.