Guest User

Untitled

a guest
Feb 13th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. import subprocess as sp
  2.  
  3. ip = "216.52.241.254"
  4. status,result = sp.getstatusoutput("ping -c1 -w2 " + ip)
  5.  
  6. if status == 0:
  7. print("System " + ip + " is UP !")
  8. else:
  9. print("System " + ip + " is DOWN !")
  10.  
  11. print(result)
Add Comment
Please, Sign In to add comment