00001
00002
00003 import os
00004 import smtplib
00005 from email.MIMEText import MIMEText
00006
00007 MERGEEXE = '/cms/mon/data/dqm/mergeAndRegister_online.py'
00008 RUN_STAT = int(os.popen('ps -ef | grep mergeAndRegister_online.py | grep -v grep | wc').read().split()[0])
00009
00010
00011 if RUN_STAT != 0:
00012 print 'mergeAndRegister_online.py is running'
00013 else:
00014 print 'mergeAndRegister_online.py stopped by unknown reason and restarted now.'
00015
00016
00017
00018 s=smtplib.SMTP("localhost")
00019 tolist=["Hyunkwan.Seo@cern.ch"]
00020 body="mergeAndRegister_online.py stopped by unknown reason and restarted now."
00021 msg = MIMEText(body)
00022 msg['Subject'] = "mergeAndRegister_online.py stopped by unknown reason and restarted now."
00023 msg['From'] = "cmsmon@cmscvs.cern.ch"
00024 msg['To'] = "Hyunkwan.Seo@cern.ch"
00025 s.sendmail("cmsmon@cmscvs.cern.ch",tolist,msg.as_string())
00026 s.quit()