Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted.

Reply
Thread Tools

I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted.

 
 
gavino
Guest
Posts: n/a
 
      07-01-2006
This seems easy but I have been asking tcl and python IRC chat all day
and no one gave an answer.
I have 100 servers which need a new backup server added to a text file,
and then the backup agent restarted.
If I have a list of the servers, all with same root password, and the
connection is ssh.
How do I connect to the server, cat the line to the config file, stop
adn start the agent, and then do same to next server in list and
iterate through the 100 servers.
What script would allow this?

 
Reply With Quote
 
 
 
 
Ravi Teja
Guest
Posts: n/a
 
      07-01-2006

gavino wrote:
> This seems easy but I have been asking tcl and python IRC chat all day
> and no one gave an answer.
> I have 100 servers which need a new backup server added to a text file,
> and then the backup agent restarted.
> If I have a list of the servers, all with same root password, and the
> connection is ssh.
> How do I connect to the server, cat the line to the config file, stop
> adn start the agent, and then do same to next server in list and
> iterate through the 100 servers.
> What script would allow this?


Try pxssh from pexpect. Look at the sample in the page.
http://pexpect.sourceforge.net/pxssh.html
It will allow you to automate ssh interactions.

 
Reply With Quote
 
 
 
 
LittlePython
Guest
Posts: n/a
 
      07-01-2006
Does this require a ssh client or server?

I use authpf to open up my PF firewall for internet use. Generally I just
open up putty and make a connection to the FW ( which open the ports) and
minize it till I am done. When I close putty authpf losses the ssh session
heartbeat and will then instruct the FW to close the ports. I would love to
write a simple client to do this form me instead of using putty. Do you
think these mods would work for me on a windows platform?

Thx

"Ravi Teja" <> wrote in message
news: oups.com...
>
> gavino wrote:
> > This seems easy but I have been asking tcl and python IRC chat all day
> > and no one gave an answer.
> > I have 100 servers which need a new backup server added to a text file,
> > and then the backup agent restarted.
> > If I have a list of the servers, all with same root password, and the
> > connection is ssh.
> > How do I connect to the server, cat the line to the config file, stop
> > adn start the agent, and then do same to next server in list and
> > iterate through the 100 servers.
> > What script would allow this?

>
> Try pxssh from pexpect. Look at the sample in the page.
> http://pexpect.sourceforge.net/pxssh.html
> It will allow you to automate ssh interactions.
>



 
Reply With Quote
 
gavino
Guest
Posts: n/a
 
      07-01-2006
list of servers L.txt
#cat L.txt
config file is /var/bkupexec/agent.cfg need to add "tell epobackup" to
bottom of file
# cat "tell epobackup" >> /var/bkupexec/agent.cfg
agent is /etc/init.d/agent.ini stop (and then start)
# /etc/init.d/agent.init stop
# /etc/init.d/agent.init start
os=redhat ent 4ES
I intend to use root password which is same for all 100 servers.
#now I'm stuck

Ravi Teja wrote:
> gavino wrote:
> > This seems easy but I have been asking tcl and python IRC chat all day
> > and no one gave an answer.
> > I have 100 servers which need a new backup server added to a text file,
> > and then the backup agent restarted.
> > If I have a list of the servers, all with same root password, and the
> > connection is ssh.
> > How do I connect to the server, cat the line to the config file, stop
> > adn start the agent, and then do same to next server in list and
> > iterate through the 100 servers.
> > What script would allow this?

>
> Try pxssh from pexpect. Look at the sample in the page.
> http://pexpect.sourceforge.net/pxssh.html
> It will allow you to automate ssh interactions.


 
Reply With Quote
 
Ravi Teja
Guest
Posts: n/a
 
      07-01-2006
LittlePython wrote:
> Does this require a ssh client or server?
>
> I use authpf to open up my PF firewall for internet use. Generally I just
> open up putty and make a connection to the FW ( which open the ports) and
> minize it till I am done. When I close putty authpf losses the ssh session
> heartbeat and will then instruct the FW to close the ports. I would love to
> write a simple client to do this form me instead of using putty. Do you
> think these mods would work for me on a windows platform?
>
> Thx


Pexpect needs a POSIX system. However, you can use Cygwin.

>From the website, "Pexpect does not currently work on the standard

Windows Python (see the pty requirement); however, it seems to work
fine using Cygwin."

 
Reply With Quote
 
LittlePython
Guest
Posts: n/a
 
      07-01-2006
thx,


"Ravi Teja" <> wrote in message
news: ups.com...
> LittlePython wrote:
> > Does this require a ssh client or server?
> >
> > I use authpf to open up my PF firewall for internet use. Generally I

just
> > open up putty and make a connection to the FW ( which open the ports)

and
> > minize it till I am done. When I close putty authpf losses the ssh

session
> > heartbeat and will then instruct the FW to close the ports. I would love

to
> > write a simple client to do this form me instead of using putty. Do you
> > think these mods would work for me on a windows platform?
> >
> > Thx

>
> Pexpect needs a POSIX system. However, you can use Cygwin.
>
> >From the website, "Pexpect does not currently work on the standard

> Windows Python (see the pty requirement); however, it seems to work
> fine using Cygwin."
>



 
Reply With Quote
 
Ravi Teja
Guest
Posts: n/a
 
      07-01-2006

gavino wrote:
> list of servers L.txt
> #cat L.txt
> config file is /var/bkupexec/agent.cfg need to add "tell epobackup" to
> bottom of file
> # cat "tell epobackup" >> /var/bkupexec/agent.cfg
> agent is /etc/init.d/agent.ini stop (and then start)
> # /etc/init.d/agent.init stop
> # /etc/init.d/agent.init start
> os=redhat ent 4ES
> I intend to use root password which is same for all 100 servers.
> #now I'm stuck


Read L.txt from (not your shell as you seem to be doing) Python and
connect to each one from pxssh, and send the commands you listed. I am
afraid, you will have to readup and experiment on a smaller scale. The
sample I pointed you to is a rather simple one and you don't seem to
have even tried it.

 
Reply With Quote
 
cmdrrickhunter@yaho.com
Guest
Posts: n/a
 
      07-01-2006
I would sugest looking at http://pexpect.sourceforge.net/ The Expect
metalanguage was specifically designed for the kind of things you are
trying to do. I used it recently on a project to configure 25
instances of an application, remotly, half over ssh half over telnet.

 
Reply With Quote
 
Paul McGuire
Guest
Posts: n/a
 
      07-01-2006
"gavino" <> wrote in message
news: ups.com...
> This seems easy but I have been asking tcl and python IRC chat all day
> and no one gave an answer.
> I have 100 servers which need a new backup server added to a text file,
> and then the backup agent restarted.
> If I have a list of the servers, all with same root password, and the
> connection is ssh.
> How do I connect to the server, cat the line to the config file, stop
> adn start the agent, and then do same to next server in list and
> iterate through the 100 servers.
> What script would allow this?
>


Could this project help you? http://sourceforge.net/projects/distribulator/

It sounds similar to what you describe.

-- Paul



 
Reply With Quote
 
Thorsten Kampe
Guest
Posts: n/a
 
      07-02-2006
* gavino (2006-07-01 11:34 +0000)
> This seems easy but I have been asking tcl and python IRC chat all day
> and no one gave an answer.
> I have 100 servers which need a new backup server added to a text file,
> and then the backup agent restarted.
> If I have a list of the servers, all with same root password, and the
> connection is ssh.
> How do I connect to the server, cat the line to the config file, stop
> adn start the agent, and then do same to next server in list and
> iterate through the 100 servers.
> What script would allow this?


Tentakel
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tetration (print 100^100^100^100^100^100^100^100^100^100^100^100^100^100) jononanon@googlemail.com C Programming 5 04-25-2012 08:49 PM
Dhcp Relay Agent And Acl On Sw 3750, DHCP Relay Agent and ACL on Sw 3750 Vimokh Cisco 3 09-06-2006 02:16 AM
All new updates at Testking.co.uk with all new added exams with 100 % passing guarantee Moderator Microsoft Certification 5 02-02-2006 02:48 PM
All new updates at Testking.co.uk with all new added exams with 100 % passing guarantee Moderator Microsoft Certification 0 01-23-2006 01:15 PM
Help. SessionID is x then y then x then y BodiKlamph@gmail.com ASP General 0 09-03-2005 03:02 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57