CMS 3D CMS Logo

alivecheck_mergeAndRegister.py

Go to the documentation of this file.
00001 #! /usr/bin/env python
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     #os.popen(MERGEEXE + ' &')
00016 
00017     #### send e-mail to a manager
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()

Generated on Tue Jun 9 17:33:09 2009 for CMSSW by  doxygen 1.5.4