Last active
August 29, 2015 14:01
-
-
Save JohannesGolf/46ccc7fd84d275c96ef9 to your computer and use it in GitHub Desktop.
Ping IP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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