def analytics_handler(self, msg): msg = json.loads(msg) queryid = msg['queryid'] src = msg['src'] if msg.get('type', False) == 'analyticsUpdate': msg = msg['msg'] try: send_msg(self.analytics_ws, msg, type='analyticsstatus') except Exception, e: print e
def sniffer_data_handler(self, msg): msg = json.loads(msg) # print "webmsgr received", msg queryid = msg['queryid'] src= msg['src'] msg_type = msg.get('type', False) if msg_type == "nodeupdate": data = json.loads(msg['msg']) # data = {nodes, edges, session_name} session_name = data['session_name'] try: send_msg(self.websocket_for_session[session_name], data, type=data['type']) except Exception, e: debug_output('Error sending node udpate: %s' % e, 'error')
def sniffer_data_handler(self, msg): msg = json.loads(msg) # print "webmsgr received", msg queryid = msg['queryid'] src = msg['src'] msg_type = msg.get('type', False) if msg_type == "nodeupdate": data = json.loads( msg['msg']) # data = {nodes, edges, session_name} session_name = data['session_name'] try: send_msg(self.websocket_for_session[session_name], data, type=data['type']) except Exception, e: debug_output('Error sending node udpate: %s' % e, 'error')
src= msg['src'] msg_type = msg.get('type', False) if msg_type == "nodeupdate": data = json.loads(msg['msg']) # data = {nodes, edges, session_name} session_name = data['session_name'] try: send_msg(self.websocket_for_session[session_name], data, type=data['type']) except Exception, e: debug_output('Error sending node udpate: %s' % e, 'error') elif msg_type == 'flow_statistics_update': data = json.loads(msg['msg']) # data = {flows, session_name} session_name = data['session_name'] try: send_msg(self.websocket_for_session[session_name], data, type=data['type']) except Exception, e: debug_output('Error sending flow data: %s' % e, 'error') elif msg_type == 'sniffdone': data = json.loads(msg['msg']) session_name = data['session_name'] try: send_msg(self.websocket_for_session[session_name], data, type=data['type']) except Exception, e: debug_output('Error sending stop message: %s' % e, 'error') else: print msg
data = json.loads( msg['msg']) # data = {nodes, edges, session_name} session_name = data['session_name'] try: send_msg(self.websocket_for_session[session_name], data, type=data['type']) except Exception, e: debug_output('Error sending node udpate: %s' % e, 'error') elif msg_type == 'flow_statistics_update': data = json.loads(msg['msg']) # data = {flows, session_name} session_name = data['session_name'] try: send_msg(self.websocket_for_session[session_name], data, type=data['type']) except Exception, e: debug_output('Error sending flow data: %s' % e, 'error') elif msg_type == 'sniffdone': data = json.loads(msg['msg']) session_name = data['session_name'] try: send_msg(self.websocket_for_session[session_name], data, type=data['type']) except Exception, e: debug_output('Error sending stop message: %s' % e, 'error') else: