Skip to content

The Rancher v2.x Linux log collector script

Article Number: 000020191

Environment

This logs collector project was created to collect logs from Linux Kubernetes nodes. It is designed to be used in the following environments for troubleshooting support cases:

Note: This script may not collect all necessary information when run on nodes in a Hosted Kubernetes Provider cluster.

Situation

When troubleshooting your issue, the Support team may request that you generate and provide a Support Bundle. If you are unable to generate a Support Bundle from the Rancher UI, you can manually collect the logs from the Linux Kubernetes nodes using the Rancher v2.x Linux log collector.

Resolution

Note:
This command requires curl or wget to be installed, and internet access from the node.

Logs can be collected from a Linux node using the Rancher v2.x log collector script.

The script needs to be downloaded and run directly on the node, using the root user or sudo.

Output will be written to /tmp as a tar.gz archive named <hostname>-<date>.tar.gz, the default output directory can be changed with the -d flag.

  1. Download the script as: rancher2_logs_collector.sh

Using wget:

wget --backups https://raw.githubusercontent.com/rancherlabs/support-tools/master/collection/rancher/v2.x/logs-collector/rancher2_logs_collector.sh

Using curl:

curl -OLs https://raw.githubusercontent.com/rancherlabs/support-tools/master/collection/rancher/v2.x/logs-collector/rancher2_logs_collector.sh
2. Run the script:

sudo bash rancher2_logs_collector.sh

Optional: Download and run the script in one command

curl -Ls rnch.io/rancher2_logs | sudo bash

For details on what information is collected, please refer to the Rancher v2.x log collector script README Scope of Collection section.