Pivotal Knowledge Base

Follow

How to Collect RabbitMQ Logs Using rabbitmq-collect-env script

Environment

RabbitMQ for Pivotal Cloud Foundry 1.7 and above

Pivotal RabbitMQ 3.6 and above

Purpose

The script collects RabbitMQ and selected OS logs, system-level metrics and other environment information that can provide insight into the overall state of the node.

This article demonstrate how to use this script depending on how RabbitMQ has been installed.

Procedure

Follow these steps:

  1. For PCF RabbitMQ, SSH into the Ops Manager VM.
  2. Log in using $ bosh login
  3. Use the director password found in Ops Manager -> Credentials -> Director Credentials.
  4. $ bosh ssh rabbitmq-server
  5. Enter root using the command $ sudo -i
  6. Download the script from Github to the environment. Either of the following commands can be used to download the script: 
    $ curl -LO https://raw.githubusercontent.com/rabbitmq/support-tools/master/scripts/rabbitmq-collect-env
    $ wget https://raw.githubusercontent.com/rabbitmq/support-tools/master/scripts/rabbitmq-collect-env
  7. Make the script executable using $ chmod +x rabbitmq-collect-env-pcf
  8. Run the script using $ ./rabbitmq-collect-env
  9. The above script needs to run on each node of the RabbitMQ cluster to collect the tar file separately.
  10. For OSS RabbitMQ Server, follow the above steps 6, 7 above 8 on the server.

Additional Information

The default log file location on PCF RabbitMQ is: /var/vcap/sys/log/rabbitmq-server/

# ./rabbitmq-collect-env
......_......_...........___..__.....__...EEEE...........................
[INFO] output archive: '/var/vcap/sys/log/rabbitmq-server/rabbitmq-env-<node-id>-<date>-<time>.tgz'

The default log file location on OSS RabbitMQ is: /var/log/rabbitmq/

# ./rabbitmq-collect-env
............._...........___..__.....__....._......................
[INFO] output archive: '/var/log/rabbitmq/rabbitmq-env-<node-name>-<date>-<time>.tgz'

See Also

Information on moving files off of a VM can be found here.

Comments

Powered by Zendesk