Agent on Spot Core with EAP2
Note: If you are using the shell component to access the device remotely, since the agent is running inside a Docker container, you need to shell into the host to retrieve the logs. For example, if the agent is running on Spot CORE I/O with EAP2. This instructions is based on the assumption that you are using the agent's shell component to the host machine. Otherwise, if you have direct access to the CORE IO EAP2 [e.g. using an ethernet cable, or through wifi to Spot], you can follow agent logs on docker container the instructions.
1. Shell into the Agent container
Use the shell component to access the host machine and then shell into the agent container.
When prompted for the username, enter the root
, and with no password. Please note that it only shelled into the agent's running container.
2. Shell into the Host Machine
In order to shell into the actual host machine, you need to have access to the host machine. If you have access to the host machine, you can shell into the host machine and then shell into the agent container.
ssh spot@localhost
Now you need to enter the password for the spot
user.
Sometimes, it may ask to save the ssh key, you can type yes
and press enter.
You can get the running containers' logs if you are shelled into the host machine.
3. List the Running Containers
To check the running containers, use the following command:
sudo docker ps
4. Identify the Agent Container
From the list of running containers, identify the container ID or name for the Agent process. Often, the container name is similar to dronedeploy-agent-1
. It might be slightly different based on the version of the agent.
5. Retrieve Logs Using Docker Logs
Once you identify the container name (e.g., dronedeploy-agent-1
), use the following command to view logs:
sudo docker logs dronedeploy-agent-1
Filter Logs by Time
Depending on your docker version, you can also limit the logs time window by using --since
or/and --until
flags. For example:
sudo docker logs --since "24h" dronedeploy-agent-1
6. Save Logs to a File
To save the logs to a file (e.g., agent_docker_logs.txt
), redirect the output:
sudo docker logs dronedeploy-agent-1 --since "24h" > agent_docker_logs.txt
7. Zip and Download Logs
It is recommended that you zip and download the logs for further analysis. You can use the following command:
zip agent_docker_logs.zip agent_docker_logs.txt
However since the agent is running inside a container, you need to copy the file from the host machine to the container after zipping it. You can use the following command to copy the file to the running container:
sudo docker cp agent_docker_logs.zip dronedeploy-agent-1:/home/ubuntu/agent_docker_logs.zip
Then you can use the file tab to find the file and download it. Check these instructions if you need to activate the file component.