How do we retrieve logs from a C50 container, from command line?
search cancel

How do we retrieve logs from a C50 container, from command line?

book

Article ID: 409978

calendar_today

Updated On:

Products

AppNeta

Issue/Introduction

We need to acquire the log files from the C50 Container.  We can reach the command line of the Host machine running the container.

 

Cause

From your host machine, depending upon the OS, you may wish to start by determining the containers running on the host.   

 

hostmachine:~$ sudo docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
12e45c7cfxxx appneta.azurecr.io/talos-engine:current "/app/run-engine-wra…" 4 minutes ago Up 4 minutes (healthy) cmp-aws-1_talos-001_1
b8c06663xxx appneta.azurecr.io/pathview-cmp:current "/sbin/entrypoint.sh" 4 minutes ago Up 4 minutes (healthy) 0.0.0.0:443->443/tcp, 0.0.0.0:1720->1720/udp, 0.0.0.0:3236->3236/tcp, 3237/tcp, 0.0.0.0:3236-3239->3236-3239/udp, 0.0.0.0:5060->5060/udp, 0.0.0.0:3238->3238/tcp, 0.0.0.0:33434->33434/udp, 3239/tcp cmp-aws-1_sequencer_1

Resolution

AppNeta Containers monitoring points use 2 containers, 'talos-engine" and "pathview-cmp".  In the following example, there are 2 containers with the following container ID:
b8c06663xxx 
12e45c7cfxxx

* Note that your container IDs will be different based on your deployment.

~

 
1.  To begin, from your host machine, depending upon the OS, you may wish to start by determining the containers running on the hosts, by issuing:

sudo docker ps -a
hostmachine:~$ sudo docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b8c06663xxx appneta.azurecr.io/talos-engine:current "/app/run-engine-wra…" 4 minutes ago Up 4 minutes (healthy) cmp-aws-1_talos-001_1
12e45c7cfxxx appneta.azurecr.io/pathview-cmp:current "/sbin/entrypoint.sh" 4 minutes ago Up 4 minutes (healthy) 0.0.0.0:443->443/tcp, 0.0.0.0:1720->1720/udp, 0.0.0.0:3236->3236/tcp, 3237/tcp, 0.0.0.0:3236-3239->3236-3239/udp, 0.0.0.0:5060->5060/udp, 0.0.0.0:3238->3238/tcp, 0.0.0.0:33434->33434/udp, 3239/tcp cmp-aws-1_sequencer_1
 
2.  Next you'll want to console into the 'pathview-cmp' container that you identified in the previous step.  You can use the following command to console into a docker container:

sudo docker exec -it <container id> /bin/bash
 
For example:
hostmachine:~$ sudo docker exec 12e45c7cfxxx /bin/bash --user root
 
 
3.  This should allow you to access the console of the 'pathview-cmp' container itself.   From this point, you will want to change the directory and run the debugRetrieval.sh + connect command:

cd /tmp
/opt/pathview/scripts/debugRetrieval.sh connect



4. Next you can compress the files using a the tar command, and exit the consoling of the container

tar -C /tmp -acPf debug_logs.tar.gz debugOutput
exit

 

5.  Lastly you can copy the tar from the container back to the hostmachine.

sudo docker cp <container id>:/tmp/debug_logs.tar.gz /<path_to_save_to>/debug_logs.tar.gz

For example:

hostmachine:~$ sudo docker cp 12e45c7cfxxx:/tmp/debug_logs.tar.gz /home/user/debug_logs.tar.gz

 

6.  From your PC, grab the Tar from the hostmachine.  Use scp, winscp or a similar application. 

scp <username>@<hostmachine_ip_or_hostname>:/<location>/debug_logs.tar.gz /<path on your local computer>

scp admin@hostmachine:/home/user/debug_logs.tar.gz /path/on/your/local/computer/

 

Additional Information

If you are having trouble running step 3, you can attempt to run the command without the additional connect test.

cd /tmp
/opt/pathview/scripts/debugRetrieval.sh

This will avoid some of the connectivity tests