ATLAS Offline Software
Loading...
Searching...
No Matches
panic.py
Go to the documentation of this file.
1# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2
3DEST='/queue/atlas.dqm.panic'
4
5def panic(msg):
6 import stomp
7 import json
8 from . import stompconfig
9 import sys, os
10 import traceback
11 import time
12
13 conn=stomp.Connection([('atlas-mb.cern.ch', 61013)])
14 print('panic: started connection')
15
16 conn.connect(wait=True, **stompconfig.config())
17 print('panic: connected')
18
19 header={'MsgClass':'DQ',
20 'MsgType': 'Panic',
21 'type':'textMessage',
22 'persistent': 'true',
23 'destination': DEST,
24 'ack': 'auto',
25 }
26 body=json.dumps({'msg': msg,
27 'command': sys.argv[0],
28 'arguments': sys.argv[1:],
29 'traceback': traceback.format_stack()[:-1],
30 'cwd': os.getcwd(),
31 'time': time.time(),
32 'usrtime': time.strftime('%Y-%m-%d %H:%H:%M %Z', time.localtime()),
33 })
34 conn.send(body=body, headers=header, destination=DEST, ack='auto')
35 print('panic: sent message')
36 print(header)
37 print(body)
38 conn.disconnect()
39
40if __name__ == '__main__':
41 panic('Testing!')
void print(char *figname, TCanvas *c1)