EDIT POST First Post Mark as Spam toker
Posts: 1 - Registered: 2008-07-17 22:40:50
I have written a program which in while 1 loop will keep checking the pinging of some pc.If it is not pinging, it will simply try to restart it using VISION ICE command line commands.Here is this program :-
sys.path = sys.path +
# Import the Boot Library
import boot_library as Lib
TgtDownCount = (0)
TgtDownCountReset = (0)
expectedValue = (0)
MaxTgtDownValue = (3)
#Check whether the target is up and running
x = os.system("ping 10.1.20.169")
#Check for validity "0" if connected
#print "X value is : " + x
if expectedValue == x:
# Do nothing
print "Not Connected"
print "Trying to re-connect"
TgtDownCount = TgtDownCount + 1
if MaxTgtDownValue > TgtDownCount:
TgtDownCount = TgtDownCountReset
# Reconnect the Target commands
This program is working fine.Problem Im facing is if the pc goes down in between, this code won't go to else part unless and until I press ctrl C.If I press ctrl C, it will enter the else part n re-connect...What I want is as soon as pc goes down, automatically it shall get re-connected through this script..
Please help me out at the earliest...
Thanks a lot.