Difference between revisions of "A Brain-dead Python Ping Utility"

From PeformIQ Upgrade
Jump to navigation Jump to search
(New page: ==Script== <pre> #!/usr/bin/python # # Purpose: Ping a range if IPs # # Copyright (C) Peter Harding, 2003 # All rights reserved # # $Id:$ # #-----------------------------...)
 
 
(One intermediate revision by the same user not shown)
Line 19: Line 19:
   os.system(cmd)
   os.system(cmd)
</pre>
</pre>
[[Category:Python]]
[[Category:Examples]]

Latest revision as of 17:03, 19 July 2009

Script

#!/usr/bin/python
#
#  Purpose: Ping a range if IPs
#
#  Copyright (C) Peter Harding, 2003
#                All rights reserved
#
#  $Id:$
#
#---------------------------------------------------------------------

import os

for i in range(1,20):
   cmd = "ping 10.10.10.%d" % i
   print cmd
   os.system(cmd)