473,834 Members | 2,063 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1706
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*******@yaho o.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
9114
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 distutils.core import setup import py2exe
5
1559
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 projects(both of company and myself) are established with PHP and ASP. now the questions come: 1. Could Python be used in web programming ? (i guess yes ?) 2. If the answer of above is yes, then can we programms with Python in both server and client...
2
1835
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 machines travel outside of our lan, the smtp server refuses to relay their messages. So, I thought it would be better if each machine had its own little mail sender this way, it could continue reporting no matter where it was located. These are all...
8
5270
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 virtual players. Each team is composed of 75 similar bots...i.e. governed by the same logic. Thus the contestant submits a single copy of the client and we instantiate the same program 75 times at the same time. The problem is that while executables...
28
2648
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 using the sockets module to communicate between machines on the same LAN, so that I want to do the record keeping on one machine.
1
1896
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 something to replace VBScript (not a big fan). I am currently deploying a Gentoo Linux SNMP server running Cacti in my network and would like my XP machines to report traps to this box. The SNMP service is not running by default on the machines in the
9
2435
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 different versions installed. I need to run it like 'python {script name}'. So I need to add Python to the path. How do I do this permanently without going to each computer and setting it through the GUI? I tried creating a Windows batch script...
5
4428
by: johnny | last post by:
Anyone know how I can make Machine A python script execute a python script on Machine B ?
4
1887
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 Linix & Windows Machine. If I choose python as the script for my requirement ,is python installation needed in target machines?to run the script. I know verywell python installation is default in linux but in windows iam not sure. or if any...
1
10550
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9332
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7760
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6957
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5796
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3981
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3083
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.