How to obtain logs from Operations Manager
search cancel

How to obtain logs from Operations Manager

book

Article ID: 293640

calendar_today

Updated On:

Products

Operations Manager

Issue/Introduction

This article discusses how to gather sets of logs for different high-level symptoms in Operations Manager (Ops Manager) for Tanzu Application Service (TAS) for VMs.

Environment

Product Version: 2.2

Resolution

Viewing logs for TAS for VMs components 

To troubleshoot specific TAS for VMs components by viewing their log files, browse to the Ops Manager interface. More information and procedures can be located here.


Using BOSH logs 

Log in to the BOSH Director VM using the instructions located here. Executing bosh logs gathers a job or agent log from a VM and supports the ability to custom filter for job logs. Refer to the example below. More information can also be located here.

$ bosh logs JOB [INDEX] [--agent] [--job] [--only filter1,filter2,...] [--dir DESTINATION_DIRECTORY]


For example:

ubuntu@pivotal-ops-manager:~$ bosh logs cloud_controller-partition-20bc6a9176da72780c3b 0
Acting as user 'director' on deployment 'cf-6459b57b83e9c423ef95' on 'p-bosh-e2258c2b24ba4aa2147c'
Director task 3062
Started fetching logs for cloud_controller-partition-20bc6a9176da72780c3b/0 > Finding and packing log files. Done (00:00:13)

Task 3062 done

Started 2016-10-03 21:04:52 UTC
Finished 2016-10-03 21:05:05 UTC
Duration 00:00:13
Downloading log bundle (911b0b74-d70b-4258-644e-62b2167215a5)...

Logs saved in `/home/ubuntu/cloud_controller-partition-20bc6a9176da72780c3b.0.2016-10-03-21-05-12.tgz`

Manually 

To access and retrieve logs from any VM you will need to bosh ssh into the VM using the instructions listed here. From there you will need to view and zip up the logs located within the /var/vcap/sys/log and /var/vcap/bosh/log directories. Lastly, either Secure Copy Protocol (SCP) the files off of the VM to another host or use bosh scp to download them from the VM.

For example:

$ bosh ssh uaa
Acting as user 'director' on deployment 'cf-d64352fb2b6448ffaf14' on 'p-bosh-52be3fb48efa2c6c8210'
...
Starting interactive shell on job uaa/
$ sudo su
# tar vczf /tmp/logs.tar.gz -C /var/vcap sys/log/ bosh/log/
sys/log/
sys/log/route_registrar_ctl.log
sys/log/uaa/
...
bosh/log/ntpdate.out
bosh/log/lock
bosh/log/@4000000057f1d72c392639e4.s
bosh/log/current
# exit
$ exit
$ bosh scp --download uaa 0 /tmp/logs.tar.gz .
Acting as user 'director' on deployment 'cf-d64352fb2b6448ffaf14' on 'p-bosh-52be3fb48efa2c6c8210'
...
Downloaded file to ./logs.tar.gz.uaa.


For more information as to all the different types of logs to gather and how they can be accessed, refer to the documentation here.

 

Additional Information

For more documentation as to all the different types of logs to gather and how they can be accessed, can be located here.