Professional Web Applications Themes

Remote script execution - PERL Beginners

Hello Friends, I would be really grateful if someone could help me out with this. I want to write a script that when executed will get lots of details from 10 different Unix(AIX) and Windows(XP) boxes and generate a report. The details to be gathered about the machines include : 1) Names and versions of all the softwares on the machines. 2) Disk space usage. Etc... Please guide me how I could go about it... I am not aware of how a script running on 1 machine take data from commands that are to be run on other...(like rsh) Thanks ...

  1. #1

    Default Remote script execution

    Hello Friends,

    I would be really grateful if someone could help me out with this.

    I want to write a script that when executed will get lots of details from 10
    different Unix(AIX) and Windows(XP) boxes and generate a report.

    The details to be gathered about the machines include :

    1) Names and versions of all the softwares on the machines.

    2) Disk space usage.

    Etc...

    Please guide me how I could go about it...

    I am not aware of how a script running on 1 machine take data from commands
    that are to be run on other...(like rsh)

    Thanks in advance
    -aman


    Aman Thind Guest

  2. #2

    Default RE: Remote script execution

    Thind, Aman <aman.thindfidelity.co.in> wrote:
    :
    : Hello Friends,
    :
    : I would be really grateful if someone could help me out with
    : this.
    :
    : I want to write a script that when executed will get lots of
    : details from 10 different Unix(AIX) and Windows(XP) boxes and
    : generate a report.
    :
    : The details to be gathered about the machines include :
    [snip]

    How are the machines connected?


    Charles K. Clarkson
    --
    Head Bottle Washer,
    Clarkson Energy Homes, Inc.
    Mobile Home Specialists
    254 968-8328

    Charles K. Clarkson Guest

  3. #3

    Default Re: Remote script execution

    For Quality purpouses, Thind, Aman 's mail on Thursday 05 February 2004 06:24
    may have been monitored or recorded as:
    > Hello Friends,
    Hi
    > I want to write a script that when executed will get lots of details from
    > 10 different Unix(AIX) and Windows(XP) boxes and generate a report.
    >
    > The details to be gathered about the machines include :
    >
    > 1) Names and versions of all the softwares on the machines.
    >
    > 2) Disk space usage.
    >
    > Etc...
    my ideas:

    either see if you can get these information from each of these machines by
    establishing a telnet or ssh connection to them and remotly executing
    commands (maybe own perlscripts) on the remote machines - Net::Telnet
    from CPAN allows you client side connections using the telnet protocol.
    Net::SSH goes for ssh.

    Or - but that gets complicated: write client and server side software using
    IO::Socket and establish your own commands.

    Since you will probably need OS depending software on the remote machines
    anyway to get you infos I would go with the first solution.

    Also take a look at the available remote backup solutions on the net: maybe
    you find something to modify.

    But maybe you first want to see how OS dependend your queries are and what
    "lots" means: your network admin might appreciate the idea of localy
    generating the reports and sending them to the query machine at once
    instead of generating them by remotly executing commands.

    I think, whether you go with a centralisied or local solution depends on how
    often you expect to change the details you want to query and the frequency in
    which new systems and OSs are added to your net.
    If seldom or never, you might think of generating the reports localy and
    mailing them independently to the query machine (eg, via email).
    If frequently, then you might not want to run arround and change your local
    scripts everytime - see first ideas.

    You see: it gets out of hand - i better stop here.

    good luck, Wolf

    Wolf Blaum Guest

  4. #4

    Default RE: Remote script execution

    Hello Charles,

    We have a 100 mbps LAN running tcp\ip...typical to company networks.

    Thanks
    Aman Thind

    -----Original Message-----
    From: Charles K. Clarkson [mailto:cclarksonhtcomp.net]
    Sent: 05 February 2004 11:31
    To: [email]beginnersperl.org[/email]
    Subject: RE: Remote script execution


    Thind, Aman <aman.thindfidelity.co.in> wrote:
    :
    : Hello Friends,
    :
    : I would be really grateful if someone could help me out with
    : this.
    :
    : I want to write a script that when executed will get lots of
    : details from 10 different Unix(AIX) and Windows(XP) boxes and
    : generate a report.
    :
    : The details to be gathered about the machines include :
    [snip]

    How are the machines connected?


    Charles K. Clarkson
    --
    Head Bottle Washer,
    Clarkson Energy Homes, Inc.
    Mobile Home Specialists
    254 968-8328


    --
    To unsubscribe, e-mail: [email]beginners-unsubscribeperl.org[/email]
    For additional commands, e-mail: [email]beginners-helpperl.org[/email]
    <http://learn.perl.org/> <http://learn.perl.org/first-response>

    Aman Thind Guest

  5. #5

    Default RE: Remote script execution

    Thind, Aman <aman.thindfidelity.co.in> wrote:
    :
    : We have a 100 mbps LAN running tcp\ip...typical to company networks.
    :
    : -----Original Message-----
    : From: Charles K. Clarkson [mailto:cclarksonhtcomp.net]
    : Sent: 05 February 2004 11:31
    : To: [email]beginnersperl.org[/email]
    : Subject: RE: Remote script execution
    :
    :
    : Thind, Aman <aman.thindfidelity.co.in> wrote:
    : :
    : : Hello Friends,
    : :
    : : I would be really grateful if someone could help me out with
    : : this.
    : :
    : : I want to write a script that when executed will get lots of
    : : details from 10 different Unix(AIX) and Windows(XP) boxes and
    : : generate a report.
    : :
    : : The details to be gathered about the machines include :
    : [snip]
    :
    : How are the machines connected?
    :

    You might try the Operating System Interfaces section of CPAN:

    [url]http://search.cpan.org/modlist/Operating_System_Interfaces[/url]


    The Quota module seems to do much of what you want. I don't
    have experience with your problem. Perhaps someone else will come
    on later and suggest a better module to start with.

    HTH,

    Charles K. Clarkson
    --
    Head Bottle Washer,
    Clarkson Energy Homes, Inc.
    Mobile Home Specialists
    254 968-8328

    Charles K. Clarkson Guest

  6. #6

    Default RE: Remote script execution


    > -----Original Message-----
    > From: Thind, Aman [mailto:aman.thindfidelity.co.in]
    > Sent: Wednesday, February 04, 2004 10:25 PM
    > To: [email]beginnersperl.org[/email]
    > Subject: Remote script execution
    >
    >
    > Hello Friends,
    >
    > I would be really grateful if someone could help me out with this.
    >
    > I want to write a script that when executed will get lots of
    > details from 10
    > different Unix(AIX) and Windows(XP) boxes and generate a report.
    As Wolf pointed out, this can get complex. Here's some code that
    ssh's to a remote machine, runs a little script "/usr/newPort/addOne.pl"
    (not shown) to add one to a number in a file "portNum" on the remote
    machine, then ssh's to the machine again and uses "cat" to assign the new
    number in the file to a variable $port for the script on the local machine.

    qx/\/usr\/bin\/ssh -n -l root 172.26.10.10 'perl
    \/usr\/newPort\/addOne.pl'/;
    $port = qx/\/usr\/bin\/ssh -n -l root 172.26.10.10 'cat
    \/usr\/newPort\/portNum'/;
    chomp $port;

    Please investigate the difference between "qx" and "system"-- they
    are not the same. For the first example above, either would work; for the
    second, only "qx" will work. That you need to capture information leads me
    to think you probably need "qx", but I could be wrong. For "ssh" and "perl"
    and "cat" in the examples above, substitute whatever you need to do to get
    your information on the remote machines.
    I hope that's enough information to get you started...
    -Chris

    Chris McMahon Guest

  7. #7

    Default RE: Remote script execution

    Hi there,
    > > Hello Friends,
    > >
    > > I would be really grateful if someone could help me out with this.
    > >
    > > I want to write a script that when executed will get lots of
    > > details from 10
    > > different Unix(AIX) and Windows(XP) boxes and generate a report.
    >
    Sorry if this has already been mentioned (I didn't get the original message),
    but if what you want to do is have some degree of interaction in the remote
    machine you might want to consider Perl-Expect :
    [url]http://sourceforge.net/projects/expectperl[/url]

    I actually use it for a very similar task as yours, running periodically to
    obtain data (ram, hard disk space, etc) on a large number of machines in our
    institute. (It can do for you so much more than just this, but this is also
    possible).

    Cheers,
    Angel de Vicente
    --
    ----------------------------------
    [url]http://www.iac.es/galeria/angelv/[/url]

    PostDoc Software Support
    Instituto de Astrofisica de Canarias

    Angel De Vicente Guest

Similar Threads

  1. timing a script execution
    By cicovec-at-hotmail in forum Coldfusion - Advanced Techniques
    Replies: 3
    Last Post: April 5th, 07:54 PM
  2. <img> tag ASP script execution
    By Mike Kanski in forum ASP
    Replies: 2
    Last Post: September 15th, 08:07 PM
  3. execution of script from button
    By Bharat in forum PERL Miscellaneous
    Replies: 3
    Last Post: September 11th, 06:05 PM
  4. [PHP] Script Execution Time
    By Chris W. Parker in forum PHP Development
    Replies: 2
    Last Post: July 29th, 10:35 AM
  5. Script Execution Time
    By Radek Zajkowski in forum PHP Development
    Replies: 3
    Last Post: July 28th, 09:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139