User Tools

Site Tools


restart_process_and_send_mail_if_fail

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revision Both sides next revision
restart_process_and_send_mail_if_fail [2012/04/10 14:29]
k2patel created
restart_process_and_send_mail_if_fail [2012/04/10 14:29]
k2patel
Line 17: Line 17:
  
 # Define you email id to notify # Define you email id to notify
-toaddrs = "​[email protected]mcfapps.com"+toaddrs = "​[email protected]xyz.com"
 # Define Source Email ID # Define Source Email ID
-fromaddr = "[email protected]mcfapps.com"+fromaddr = "[email protected]pqr.com"
  
  
Line 34: Line 34:
 try: try:
     args = ['/​etc/​init.d/​postgresql',​ '​restart'​]     args = ['/​etc/​init.d/​postgresql',​ '​restart'​]
-    #​subprocess.Popen(args,​ shell=True) 
     subprocess.check_call(args)     subprocess.check_call(args)
 except subprocess.CalledProcessError as prit: except subprocess.CalledProcessError as prit:
restart_process_and_send_mail_if_fail.txt ยท Last modified: 2012/04/10 14:30 by k2patel