diff --git a/monkey/infection_monkey/control.py b/monkey/infection_monkey/control.py index 22d0fac92..5f3c5372a 100644 --- a/monkey/infection_monkey/control.py +++ b/monkey/infection_monkey/control.py @@ -13,6 +13,7 @@ from infection_monkey.config import GUID from infection_monkey.island_api_client import IIslandAPIClient from infection_monkey.network.info import get_host_subnets from infection_monkey.utils import agent_process +from infection_monkey.utils.ids import get_agent_id disable_warnings() # noqa DUO131 @@ -70,8 +71,9 @@ class ControlClient: def send_log(self, log): try: - telemetry = {"monkey_guid": GUID, "log": json.dumps(log)} - self._island_api_client.send_log(GUID, json.dumps(telemetry)) + monkey_guid = get_agent_id() + log_contents = json.dumps(log) + self._island_api_client.send_log(monkey_guid, log_contents) except Exception as exc: logger.warning(f"Error connecting to control server {self.server_address}: {exc}")