How to ping and shutdown a remote computer?

joja15 at gmail.com joja15 at gmail.com
Wed Feb 14 11:07:02 EST 2007


I am working on a Python script to perform as a remote computer
manager. So far I have a WOL function working and I would like to add
the ability to show if a machine is on or off (I figured I would do so
by pinging the machine and seeing if I get a response). I would also
like to add the ability to remotely shutdown a computer from the
python script. Does anyone have a code snippet for pinging an IP, a
code snippet for shutting down a remote Windows XP machine, and a code
snippet for sending a HTTP request?

Here is my current setup:

- PC  running python script
- FreeNAS (media server running on FreeBSD. Can be shutdown from web
interface so I planned on just sending that same web button click from
the python script to shutdown the FreeNAS server)
- Windows XP machine with folder share (What packet is sent over the
network to remotely shutdown a Windows XP machine?)

My hope is to have a script then when you start it will list all your
remote computers/servers and show if they are currently on/off. Then
you can select a server and turn it off if it is on or turn it on if
it is off.

Thank you in advance for any help provided.

- John




More information about the Python-list mailing list