Skip to content

Instantly share code, notes, and snippets.

@JohannesGolf
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohannesGolf/46ccc7fd84d275c96ef9 to your computer and use it in GitHub Desktop.
Save JohannesGolf/46ccc7fd84d275c96ef9 to your computer and use it in GitHub Desktop.
Ping IP
import subprocess
print "###################"
print "Das folgene kann ignoriert werden:"
subprocess.os.system("sudo arp -a -d")
print "###################"
print " "
print "###################"
print "Programm Start"
print "###################"
print " "
times = 0
ip_host = raw_input("Gib den Host-Anteil der letzten IP-Adresse ein, die getestet werden soll: ")
while times <= int(ip_host):
ip = 'X.X.X.' + str(times)
if subprocess.os.system("ping -c 1 " + ip) == 0:
print "###################"
print ip + " ist erreichbar."
print "Die MAC-Adresse im ARP-Reply:"
subprocess.os.system("sudo arp -a")
print " "
print "Address-Resolution-Protocol-Liste wird geleert:"
subprocess.os.system("sudo arp -a -d")
print "###################"
else:
print ip + " ist NICHT erreichbar"
print "------------------"
times = times + 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment