|
@ -50,7 +50,7 @@ def main(): |
|
|
userNumber = raw_input("Masukkan pilihan (1-3): ") |
|
|
userNumber = raw_input("Masukkan pilihan (1-3): ") |
|
|
if userNumber == "1" : |
|
|
if userNumber == "1" : |
|
|
host = raw_input("\nMasukkan alamat host : ") |
|
|
host = raw_input("\nMasukkan alamat host : ") |
|
|
p1 = subprocess.Popen(['ping','-c 5', host], stdout=subprocess.PIPE) |
|
|
|
|
|
|
|
|
p1 = subprocess.Popen(['/usr/local/bin/ping','-c 5', host], stdout=subprocess.PIPE) |
|
|
output = p1.communicate()[0] |
|
|
output = p1.communicate()[0] |
|
|
print output |
|
|
print output |
|
|
exit() |
|
|
exit() |
|
@ -61,7 +61,7 @@ def main(): |
|
|
for o in range(user): |
|
|
for o in range(user): |
|
|
host = raw_input("Masukkan alamat host ke " +str(o+1) +" : ") |
|
|
host = raw_input("Masukkan alamat host ke " +str(o+1) +" : ") |
|
|
hosts= re.sub('[|,;]', '', host) |
|
|
hosts= re.sub('[|,;]', '', host) |
|
|
pings = MaManX('ping -c 5 ' + hosts ) |
|
|
|
|
|
|
|
|
pings = MaManX('/usr/local/bin/ping -c 5 ' + hosts ) |
|
|
if (pings == 0): |
|
|
if (pings == 0): |
|
|
print host.upper(), "IS UP MAMANX" |
|
|
print host.upper(), "IS UP MAMANX" |
|
|
else : |
|
|
else : |
|
|