Changeset 879 for trunk/Monitoring/Watch/watch
- Timestamp:
- 06/13/13 07:08:13 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Monitoring/Watch/watch
r877 r879 21 21 import smtplib 22 22 from email.mime.text import MIMEText 23 from datetimeimport datetime23 import datetime 24 24 25 25 # line below is to include "smon" package in the search path … … 58 58 def store_msg(cls,message): 59 59 60 # the simu exists when we are here (see TAG0001 tag) 61 s=repo_io.retrieve_simulation(message.simuid) 62 63 repo_io.create_message(message,s) 60 try: 61 62 # the simu exists when we are here (see TAG0001 tag) 63 s=repo_io.retrieve_simulation(message.simuid) 64 65 repo_io.create_message(message,s) 66 67 sys.exit() 68 69 except: 70 traceback.print_exc() 71 raise 64 72 65 73 @classmethod … … 70 78 def set_sim_status_to_error(cls,message): 71 79 72 s=repo_io.retrieve_simulation(message.simuid) 73 74 s.status="error" 75 76 repo_io.update_simulation_status(s) 80 try: 81 82 s=repo_io.retrieve_simulation(message.simuid) 83 84 s.status="error" 85 86 repo_io.update_simulation_status(s) 87 88 except: 89 traceback.print_exc() 90 raise 77 91 78 92 @classmethod … … 103 117 # used for debug 104 118 119 """ 105 120 if message.file is not None: 106 121 print "%s %s %s %s %s\n"%(message.code,message.jobid,message.command,message.timestamp,message.file) 107 122 else: 108 123 print "%s %s %s %s\n"%(message.code,message.jobid,message.command,message.timestamp) 124 """ 125 126 print "%s %s %s %s\n"%(message.code,message.jobid,message.command,message.timestamp) 109 127 110 128 @classmethod 111 129 def log(cls,message): 112 130 with open("/home/jripsl/supervisor/log/supervisor.log", "a") as log_file: 113 log_file.write("%s %s %s %s %s\n"%(datetime. now().strftime('%Y%m%d_%H%M%S'), message.code,message.jobid,message.timestamp,message.command))131 log_file.write("%s %s %s %s %s\n"%(datetime.datetime.now().strftime('%Y%m%d_%H%M%S'), message.code,message.jobid,message.timestamp,message.command)) 114 132 115 133 @classmethod … … 239 257 message=smon.types.Message(JSON_msg) # all JSON object members will be available in smon.types.Message object 240 258 259 # non working 260 #print message.type 261 262 # working 263 #print message.code 264 241 265 242 266 … … 249 273 250 274 251 # manage config-card file which is attached to the "0000" type message (this file is base64 encoded and need to be unencoded)275 # manage config-card file which is attached to the "0000" code message (this file is base64 encoded and need to be unencoded) 252 276 # 253 277 if "file" in l__tmp_dic:
Note: See TracChangeset
for help on using the changeset viewer.