Jul-03-2018, 10:50 AM
Hi Folks,
I am trying to use the following script to check if the IP is active or not, but the result shows active irrespective of the actual status.
import sys,os
server_ip = '192.168.6.15'
rep = os.system('ping ' + server_ip)
if rep == 0:
print ('server is up ')
else:
print ('server is down')
I am trying to use the following script to check if the IP is active or not, but the result shows active irrespective of the actual status.

import sys,os
server_ip = '192.168.6.15'
rep = os.system('ping ' + server_ip)
if rep == 0:
print ('server is up ')
else:
print ('server is down')