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

jao at geophile.com jao at geophile.com
Tue Mar 28 17:37:03 CEST 2006


Quoting skip at 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)




More information about the Python-list mailing list