473,396 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

To run a python script in all the machines from one server

Hi Everyone

I want to run a python script in all the machines that are connected
through local network and collect the information about that machine
such as HDD size, RAM capacity(with number of slots) ,processer speed
etc.

But i want to run a script from just the server, so that it should
start scripts in all other machines, and get their local machines
information and dump the same information in some FTP.

Could you please let me know how can i do this??

Thanks
Yogi

Mar 28 '06 #1
7 1679
mu*******@yahoo.com wrote:
Hi Everyone

I want to run a python script in all the machines that are connected
through local network and collect the information about that machine
such as HDD size, RAM capacity(with number of slots) ,processer speed
etc.

But i want to run a script from just the server, so that it should
start scripts in all other machines, and get their local machines
information and dump the same information in some FTP.

Could you please let me know how can i do this??

Thanks
Yogi

You could create a xmlrpc server on all clients, that listens for such a
request, then your server (which is an xmlrpc client) calls all the
clients on the appropriate exposed function, then the client proceeds on
gathering the required information and puts it using ftplib on the ftp
share. It is also possible to return all info via the xmlrpc call and
let the server do the ftp part, all depends on your requirements.

If your on a NT only network a better route would be to use WMI.

--
mph
Mar 28 '06 #2
mu*******@yahoo.com wrote:
Hi Everyone

I want to run a python script in all the machines that are connected
through local network and collect the information about that machine
such as HDD size, RAM capacity(with number of slots) ,processer speed
etc.

But i want to run a script from just the server, so that it should
start scripts in all other machines, and get their local machines
information and dump the same information in some FTP.

Could you please let me know how can i do this??

Thanks
Yogi


Take a look at: http://pybuild.sf.net/pyinvoke.html or
http://rpyc.sourceforge.net
Mar 28 '06 #3
mu*******@yahoo.com <mu*******@yahoo.com> wrote:
I want to run a python script in all the machines that are connected
through local network and collect the information about that machine
such as HDD size, RAM capacity(with number of slots) ,processer speed
etc.

But i want to run a script from just the server, so that it should
start scripts in all other machines, and get their local machines
information and dump the same information in some FTP.

Could you please let me know how can i do this??


If these are unix machines then I would use ssh/scp.

Use scp to copy the script to /tmp then run it and collect the output
with ssh (and os.popen/subprocess)

You can set ssh/scp up with keys too.

Number of RAM slots is reasonably hard to obtain. You might want to
investigate dmidecode for unix which queries the bios. It gives you
stuff like this showing my machine has 4 slots, with 2x512 MB in.

Handle 0x0007, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: A0
Bank Connections: 1 2
Current Speed: Unknown
Type: ECC DIMM SDRAM
Installed Size: 512 MB (Double-bank Connection)
Enabled Size: 512 MB (Double-bank Connection)
Error Status: OK

Handle 0x0008, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: A1
Bank Connections: 3 4
Current Speed: Unknown
Type: Unknown
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK

Handle 0x0009, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: A2
Bank Connections: 5 6
Current Speed: Unknown
Type: ECC DIMM SDRAM
Installed Size: 512 MB (Double-bank Connection)
Enabled Size: 512 MB (Double-bank Connection)
Error Status: OK

Handle 0x000A, DMI type 6, 12 bytes
Memory Module Information
Socket Designation: A3
Bank Connections: 7 8
Current Speed: Unknown
Type: Unknown
Installed Size: Not Installed
Enabled Size: Not Installed
Error Status: OK

--
Nick Craig-Wood <ni**@craig-wood.com> -- http://www.craig-wood.com/nick
Mar 28 '06 #4
Nick Craig-Wood enlightened us with:
If these are unix machines then I would use ssh/scp.

Use scp to copy the script to /tmp then run it and collect the output
with ssh (and os.popen/subprocess)


I'd use ssh only. Just give a 'cat > /tmp/myscript.sh' command, then
output the contents of the script, followed by CTRL+D. That also
enables you to get the output directly (by giving the result of the
script on stdout) instead of having to create an FTP server too.

Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself?
Frank Zappa
Mar 28 '06 #5
Nick Craig-Wood wrote:
If these are unix machines then I would use ssh/scp.


Even if they are Windows PCs, you could just install cygwin, openssh,
and python.
Mar 28 '06 #6

Yogi> I want to run a python script in all the machines that are
Yogi> connected through local network and collect the information about
Yogi> that machine such as HDD size, RAM capacity(with number of slots)
Yogi> ,processer speed etc.

Yogi> But i want to run a script from just the server, so that it should
Yogi> start scripts in all other machines, and get their local machines
Yogi> information and dump the same information in some FTP.

Yogi> Could you please let me know how can i do this??

Take a look at Nagios and plugins line nrpe.

Skip
Mar 28 '06 #7
jao
Quoting sk**@pobox.com:

Yogi> I want to run a python script in all the machines that are
Yogi> connected through local network and collect the information about
Yogi> that machine such as HDD size, RAM capacity(with number of slots)
Yogi> ,processer speed etc.

Yogi> But i want to run a script from just the server, so that it should
Yogi> start scripts in all other machines, and get their local machines
Yogi> information and dump the same information in some FTP.

Yogi> Could you please let me know how can i do this??

Take a look at Nagios and plugins line nrpe.


Another possibility is osh (http://geophile.com/osh). You could do something
like this:

osh @your_cluster [ f 'your_function' ] $

- your_cluster: logical name for the cluster.
- your_function: A python function you write to be run on each host.
- $: Prints information from each node as a python tuple.

You could, instead of printing with $, pipe the result to other
osh commands to further process the tuples containing information
from each host.

I wouldn't recommend this if the hosts are Windows since osh hasn't
been tested on Windows.

Jack Orenstein
(author of osh)

Mar 28 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Giles Brown | last post by:
I'm feeling quite dumb this morning. I'm trying to build a COM server DLL using py2exe and it ain't working. Here's what ain't working... setup_dll.py based on py2exe sample: """from...
5
by: black | last post by:
Howdy everyone~ i heard Python could be used in web programming and aftering searching many docs just found something on Python and CGI. the fact is i know nothing about CGI and most of my...
2
by: Brad Tilley | last post by:
Anyone know of a small Python script that acts as a slimmed down smtp server (just sends from the local machine)? I currently use a smtp server for sending email reports from machines, but as...
8
by: Rahul | last post by:
Hi. I am part of a group in my univ where we organize a programming contest. In this contest we have a UDP based server. The server simulates a game and each contestant is to develop a team of...
28
by: H J van Rooyen | last post by:
Hi, I want to write a small system that is transaction based. I want to split the GUI front end data entry away from the file handling and record keeping. Now it seems almost trivially easy...
1
by: KDawg44 | last post by:
Hi, I am very new to Python and really just began studying and using it. I read that it was relatively easy to interact with Windows machines with Python and I am desperately looking for...
9
by: kyle | last post by:
I have many users using two different versions of python, 2.4 and 2.5. I am running Python scripts on their computers programmatically, but I can't run it with the full path because they have...
5
by: johnny | last post by:
Anyone know how I can make Machine A python script execute a python script on Machine B ?
4
by: nirmalarasu | last post by:
Hi All, Currently iam looking for one common script to work both in linux and windows target machines.The script what i going to write need to be loaded in CD. The CD scripts will be used both in...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.