Last active
August 29, 2015 14:01
-
-
Save JohannesGolf/ae1f5ca13d881e487011 to your computer and use it in GitHub Desktop.
Informationen per Ping-Befehl
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 | |
subprocess.os.system("sudo arp -a -d") | |
print " " | |
print "###################" | |
print "Programm Start" | |
print "###################" | |
print " " | |
times = int(raw_input("Gib den Host-Anteil der ersten IP-Adresse ein, die getestet werden soll: ")) | |
ip_host = int(raw_input("Gib den Host-Anteil der letzten IP-Adresse ein, die getestet werden soll: ")) | |
free_ip_list = [] | |
remit_ip_list = [] | |
while times <= ip_host: | |
ip = 'X.X.X.' + str(times) | |
if subprocess.os.system("ping -c 2 " + ip) == 0: | |
remit_ip_list.append(ip) | |
else: | |
free_ip_list.append(ip) | |
print " " | |
print "------------------" | |
times = times + 1 | |
print "Name IP-Adresse MAC-Adresse" | |
subprocess.os.system("sudo arp -a") | |
print " " | |
print "Vergebene IP's:" | |
print remit_ip_list | |
print "Freie/Nichterreichbare IP's:" | |
print free_ip_list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment