forked from p34709852/monkey
Change tunnel telemetry format to fit expected structure
This commit is contained in:
parent
643b445199
commit
77f7e4c5a8
|
@ -86,7 +86,7 @@ class ChaosMonkey(object):
|
||||||
|
|
||||||
self._default_server = WormConfiguration.current_server
|
self._default_server = WormConfiguration.current_server
|
||||||
LOG.debug("default server: %s" % self._default_server)
|
LOG.debug("default server: %s" % self._default_server)
|
||||||
ControlClient.send_telemetry("tunnel", ControlClient.proxies.get('https'))
|
ControlClient.send_telemetry("tunnel", {'proxy': ControlClient.proxies.get('https')})
|
||||||
|
|
||||||
if WormConfiguration.collect_system_info:
|
if WormConfiguration.collect_system_info:
|
||||||
LOG.debug("Calling system info collection")
|
LOG.debug("Calling system info collection")
|
||||||
|
|
|
@ -60,8 +60,8 @@ class Telemetry(flask_restful.Resource):
|
||||||
|
|
||||||
def process_tunnel_telemetry(self, telemetry_json):
|
def process_tunnel_telemetry(self, telemetry_json):
|
||||||
monkey_id = NodeService.get_monkey_by_guid(telemetry_json['monkey_guid'])["_id"]
|
monkey_id = NodeService.get_monkey_by_guid(telemetry_json['monkey_guid'])["_id"]
|
||||||
if telemetry_json['data']:
|
if telemetry_json['data']['proxy'] is not None:
|
||||||
host = telemetry_json['data'].split(":")[-2].replace("//", "")
|
host = telemetry_json['data']['proxy'].split(":")[-2].replace("//", "")
|
||||||
tunnel_host_id = NodeService.get_monkey_by_ip(host)["_id"]
|
tunnel_host_id = NodeService.get_monkey_by_ip(host)["_id"]
|
||||||
NodeService.set_monkey_tunnel(monkey_id, tunnel_host_id)
|
NodeService.set_monkey_tunnel(monkey_id, tunnel_host_id)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue