Connect to multiple unix servers

Discussion in 'Perl Misc' started by darkknight56, Nov 18, 2008.

  1. darkknight56

    darkknight56 Guest

    Hello. I'm new at perl and am faced with a problem. I work with
    multiple unix servers and I need to execute the same commands on each
    of them. I'd like to automate this with perl so I was hoping someone
    could point me in the right direction as to what package to use or
    where there may be some code snippets I could learn from and modify.
    I know there is the telnet module but if I fail to connect on one
    server, I still need to proceed onto the next one.

    Any help would be appreciated.

    darkknight56
    darkknight56, Nov 18, 2008
    #1
    1. Advertising

  2. darkknight56 wrote:

    > Hello. I'm new at perl and am faced with a problem. I work with
    > multiple unix servers and I need to execute the same commands on each
    > of them.


    Debian distributed shell is your friend.

    HTH...

    Dirk
    Dirk Heinrichs, Nov 18, 2008
    #2
    1. Advertising

  3. darkknight56

    darkknight56 Guest

    On Nov 18, 1:50 pm, Dirk Heinrichs <> wrote:
    > darkknight56 wrote:
    > > Hello.  I'm new at perl and am faced with a  problem.  I work with
    > > multiple unix servers and I need to execute the same commands on each
    > > of them.

    >
    > Debian distributed shell is your friend.
    >
    > HTH...
    >
    >         Dirk


    Sorry but I'm running a recent Activestate release of perl from a
    Windows server to the various unix servers. From windows, I need to
    connect to one unix server, execute some commands, logout from that
    box then move onto the next box and repeat the process all over again.

    Darkknight56
    darkknight56, Nov 18, 2008
    #3
  4. darkknight56

    Guest

    darkknight56 <> wrote:
    > On Nov 18, 1:50=A0pm, Dirk Heinrichs <> wrote:
    > > darkknight56 wrote:
    > > > Hello. =A0I'm new at perl and am faced with a =A0problem. =A0I work
    > > > wit=

    > h
    > > > multiple unix servers and I need to execute the same commands on each
    > > > of them.

    > >
    > > Debian distributed shell is your friend.
    > >
    > > HTH...
    > >
    > > =A0 =A0 =A0 =A0 Dirk

    >
    > Sorry but I'm running a recent Activestate release of perl from a
    > Windows server to the various unix servers. From windows, I need to
    > connect to one unix server, execute some commands, logout from that
    > box then move onto the next box and repeat the process all over again.


    Net::Telnet?

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    The costs of publication of this article were defrayed in part by the
    payment of page charges. This article must therefore be hereby marked
    advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
    this fact.
    , Nov 18, 2008
    #4
  5. writes:

    > darkknight56 <> wrote:
    >> On Nov 18, 1:50=A0pm, Dirk Heinrichs <> wrote:
    >> > darkknight56 wrote:
    >> > > Hello. =A0I'm new at perl and am faced with a =A0problem. =A0I work
    >> > > wit=

    >> h
    >> > > multiple unix servers and I need to execute the same commands on each
    >> > > of them.
    >> >
    >> > Debian distributed shell is your friend.
    >> >
    >> > HTH...
    >> >
    >> > =A0 =A0 =A0 =A0 Dirk

    >>
    >> Sorry but I'm running a recent Activestate release of perl from a
    >> Windows server to the various unix servers. From windows, I need to
    >> connect to one unix server, execute some commands, logout from that
    >> box then move onto the next box and repeat the process all over again.

    >
    > Net::Telnet?
    >

    Telnet is deprecated.

    Net::SSH will do nicely. It requires an ssh.exe on the Winbox, but
    Putty and Cygwin/OpenSSH are just another free download away.

    Mart

    --
    "We will need a longer wall when the revolution comes."
    --- AJS, quoting an uncertain source.
    Mart van de Wege, Nov 19, 2008
    #5
  6. darkknight56

    Ted Zlatanov Guest

    On Tue, 18 Nov 2008 09:56:25 -0800 (PST) darkknight56 <> wrote:

    d> Hello. I'm new at perl and am faced with a problem. I work with
    d> multiple unix servers and I need to execute the same commands on each
    d> of them. I'd like to automate this with perl so I was hoping someone
    d> could point me in the right direction as to what package to use or
    d> where there may be some code snippets I could learn from and modify.

    Perl won't solve your problem: executing commands on a distributed
    network. Check out tools like cfengine and Puppet that specialize in
    doing this (especially if the commands are not going to change much over
    time). cfengine in particular will do many of the tasks you're probably
    thinking of, like monitoring/restarting/killing processes and
    distributing files, without any custom work.

    d> I know there is the telnet module but if I fail to connect on one
    d> server, I still need to proceed onto the next one.

    You can do that with Net::Telnet and Net::SSH.

    Ted
    Ted Zlatanov, Nov 19, 2008
    #6
  7. darkknight56

    C.DeRykus Guest

    On Nov 19, 9:00 am, Mart van de Wege
    ....
    > >> From windows, I need to
    > >> connect to one unix server, execute some commands, logout from that
    > >> box then move onto the next box and repeat the process all over again.

    >
    > > Net::Telnet?

    >
    > Telnet is deprecated.
    > ...


    Net::Telnet can be useful running over an ssh connection to change
    passwords however.

    --
    Charles DeRykus
    C.DeRykus, Nov 19, 2008
    #7
  8. "C.DeRykus" <> writes:

    > On Nov 19, 9:00 am, Mart van de Wege
    > ...
    >> >> From windows, I need to
    >> >> connect to one unix server, execute some commands, logout from that
    >> >> box then move onto the next box and repeat the process all over again.

    >>
    >> > Net::Telnet?

    >>
    >> Telnet is deprecated.
    >> ...

    >
    > Net::Telnet can be useful running over an ssh connection to change
    > passwords however.


    Well yeah. There is equipment out there that doesn't speak SSH yet, so
    Telnet-over-SSH is a decent solution for that.

    OTOH, for the parent use case, Telnet is definitely deprecated.

    Mart

    --
    "We will need a longer wall when the revolution comes."
    --- AJS, quoting an uncertain source.
    Mart van de Wege, Nov 20, 2008
    #8
  9. darkknight56 wrote:

    > Sorry but I'm running a recent Activestate release of perl from a
    > Windows server to the various unix servers.


    Either use putty in a simple for loop, or check wether dsh is available under cygwin.

    Bye...

    Dirk
    Dirk Heinrichs, Nov 21, 2008
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Otis Mukinfus
    Replies:
    3
    Views:
    893
    Juan T. Llibre
    Jul 8, 2005
  2. Replies:
    3
    Views:
    40,125
    Roedy Green
    Nov 16, 2005
  3. Replies:
    2
    Views:
    259
  4. Mohsen Pahlevanzadeh

    Qt connect and first connect or unicode

    Mohsen Pahlevanzadeh, Sep 17, 2013, in forum: Python
    Replies:
    3
    Views:
    134
    Mohsen Pahlevanzadeh
    Sep 18, 2013
  5. Mohsen Pahlevanzadeh

    Re: Qt connect and first connect or unicode

    Mohsen Pahlevanzadeh, Sep 17, 2013, in forum: Python
    Replies:
    0
    Views:
    105
    Mohsen Pahlevanzadeh
    Sep 17, 2013
Loading...

Share This Page