import os, sys, time
while True:
time.sleep(4)
try:
ret = os.popen('ps -C sample -o pid,cmd').readlines() # 所需監控程式
if len(ret) < 2:
time.sleep(3)
os.system("~/remote/sample host SID rdz.orbwebsys.com") # 程式重新啟動
except:
print "Error", sys.exc_info()[1]
沒有留言:
張貼留言