Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 3rd, 2004, 09:36 AM
luckyboy luckyboy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 57 luckyboy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 46 m 58 sec
Reputation Power: 5
Ping

Hi All

Do any one know how to write a programme in python to ping one or more than one Pc's and print ok to successful no to unsuccessful. An example would be great.

Thanks

Reply With Quote
  #2  
Old June 3rd, 2004, 10:18 AM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 7
Send a message via MSN to Grim Archon
I googled this:
http://pynms.sourceforge.net/

You will find a ping module there.

Grim
__________________
*** Experimental Python Markup CGI V2 ***

Reply With Quote
  #3  
Old June 4th, 2004, 05:33 AM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 7
Send a message via MSN to Grim Archon
This link has a Python 1.4 module for ping and traceroute.
http://www.python.org/~jeremy/python.html

You may need to do some conversion work.

grim

Reply With Quote
  #4  
Old June 4th, 2004, 06:36 AM
xlordt's Avatar
xlordt xlordt is offline
Only the strong survives!!.
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Feb 2003
Location: A World of wonders.
Posts: 5,548 xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 109960 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109960 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109960 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109960 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109960 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109960 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Month 1 h 59 m 56 sec
Reputation Power: 378
Send a message via ICQ to xlordt Send a message via AIM to xlordt Send a message via MSN to xlordt Send a message via Yahoo to xlordt Send a message via Google Talk to xlordt Send a message via Skype to xlordt
Facebook MySpace
I coded one not to long ago.. if ya still need it.. let me know and i will look fo it for ya

Reply With Quote
  #5  
Old June 4th, 2004, 07:47 AM
luckyboy luckyboy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 57 luckyboy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 46 m 58 sec
Reputation Power: 5
HI xlordt

It will be graet if you could post the cade

Thanks

Reply With Quote
  #6  
Old June 4th, 2004, 09:55 AM
xlordt's Avatar
xlordt xlordt is offline
Only the strong survives!!.
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Feb 2003
Location: A World of wonders.
Posts: 5,548 xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)xlordt User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 109960 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109960 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109960 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109960 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109960 Folding Title: Super Ultimate Folder - Level 1Folding Points: 109960 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Month 1 h 59 m 56 sec
Reputation Power: 378
Send a message via ICQ to xlordt Send a message via AIM to xlordt Send a message via MSN to xlordt Send a message via Yahoo to xlordt Send a message via Google Talk to xlordt Send a message via Skype to xlordt
Facebook MySpace
Code:
import os

for x in file( "adress.txt" ):

    address, ports = x.strip( ).split( ":" )
    Ping  = os.system( "ping -w 1 -a " + address + " > null.txt" )

    if Ping == 1:
        print address, "\t[Not Good]"
    else:
        print address, "\t[Yes Good]"


I hade a better one, but i cant find it.. i know i put it in one of my floopys.. so i will look for that one laters.. this one i coded it at a friends house.. cause im not home.. but if this will do you.. then kool... else let me know and i will look for it when i get home laters good luck, btw this works on windows.. on linux i would use > /dev/null.. dont know if windows has one

Last edited by xlordt : June 4th, 2004 at 10:05 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Ping


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT