Log Artifacts Collection

Logs can be gathered from all Lightbits servers configured in the hosts file.

Notes

For each command below, two variations are provided.

  • Ansible Method: Choose this if you have deployed or are deploying Lightbits using Ansible.

  • Docker Method: Select this if you have deployed or are deploying Lightbits using a combination of Docker and Ansible.

Additionally, each Docker example requires the correct Docker image URL: docker.lightbitslabs.com/lightos-3-(Minor Ver)-(Rev)-rhl-(9/10)/lb-ansible:v9.13.0-1. The repository part of the path is incomplete and requires substitution. The Lightbits Installation Customer Addendum provides your repository name and token: replace lightos-3-(Minor Ver)-(Rev)-rhl-(9/10) with the repository name, and use the token to log in to Docker, as described in Preparing the Installation Workstation (Ansible Controller).

If using the Ansible method, run this:

cd ~/light-app
ansible-playbook -i ansible/inventories/cluster_example/hosts playbooks/logs.yml -vvv

If using the Docker method, run this:

cd ~/light-app
docker run -it --rm --net=host \
-e UID=`id -u` \
-e GID=`id -g` \
-e UNAME=$USER \
-v `pwd`:/ansible \
-w /ansible \
-e ANSIBLE_LOG_PATH=/ansible/ansible.log \
docker.lightbitslabs.com/lightos-3-(Minor Ver)-(Rev)-rhl-(9/10)/lb-ansible:v9.13.0-1 \
sh -c 'ansible-playbook -i ansible/inventories/cluster_example/hosts playbooks/logs.yml -vvv'

The output of each Lightbits server is saved into a dated directory inside /tmp/ on the Ansible host.

Notes

This playbook can be executed on servers with or without Lightbits installed.

JWT Configuration:

For proper log collection from Lightbits servers, the playbook requires the JWT to be in the ~/lightos-system-jwt file.

This step is optional if the Lightbits servers have the JWT configured in /etc/lbcli/lbcli.yaml.

Customizable Parameters:

You can modify the following parameters when running the playbook:

log_days: Duration of logs to gather in days.

log_local_prefix_dir: Output directory for logs on the Ansible host.

system_jwt_path: Location of the JWT file on the Ansible host.

Example command:

ansible-playbook -i ansible/inventories/cluster_example/hosts playbooks/logs.yml -e log_days=7 -e log_local_prefix_dir=/ansible/logs -e system_jwt_path=/ansible/lightos_jwt

Additional Information:

For more details about the log collector, refer to the README.md file in the light-app/roles/logs-collector/ directory.

Manual Log Collection:

  • The logs playbook uses lb-support.sh to gather logs, which can also be executed manually.

  • For inactive, unattached nodes - or when services are unresponsive - use:

lb-support.sh -s 7 -l $(hostname -s)

  • The -s 7 parameter sets a seven-day log capture duration (adjust this based on when the issue started).

  • The -l $(hostname -s) option adds the server's hostname to the log tarball filename, for easy identification.

  • Send the resulting tarball and issue details to Lightbits Support for evaluation, and to determine if any interventions are necessary.

For additional log collection options, see lbcli fetch logs.