Skip to content

Script to assist in gathering logs and other debugging info from a Juju model

License

Notifications You must be signed in to change notification settings

juju/juju-crashdump

Repository files navigation

juju-crashdump

Script to assist in gathering logs and other debugging info from a Juju model

Installation

The best way to install this plugin is via the snap:

sudo snap install --classic juju-crashdump

However, you can also install using pip:

sudo pip install git+https://github.com/juju/juju-crashdump.git

Usage

juju crashdump [-h] [-d] [-m MODEL] [-f MAX_FILE_SIZE] [-b BUG]
               [-o OUTPUT_DIR] [-u UNIQ] [-s] [-a ADDON]
               [--addons-file ADDONS_FILE]
               [extra_dir [extra_dir ...]]
extra_dir
Extra directories to snapshot
-h, --help
show this help message and exit
-d, --description
Output a short description of the plugin
-m MODEL, --model MODEL
Model to act on
-f MAX_FILE_SIZE, --max-file-size MAX_FILE_SIZE
The max file size (bytes) for included files
-b BUG, --bug BUG
Upload crashdump to the given launchpad bug #
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
Store the completed crash dump in this dir.
-u UNIQ, --uniq UNIQ
Unique id for this crashdump. We generate a uuid if this is not specified.
-s, --small
Make a 'small' crashdump, by skipping the contents of /var/lib/juju.
-a ADDON, --addon ADDON
Enable the addon with the given name
--addons-file ADDONS_FILE
Use this file for addon definitions
--as-root
Collect logs as root, may contain passwords etc. Addons with local commands will only run if this flag is enabled.

Addons

Addons can be used to collect information that is not already present in files on the nodes. The following addons can be chosen from:

  • crm-status
  • listening (shows netstat)
  • psaux
  • juju-show-unit
  • juju-show-status-log
  • juju-show-machine
  • ps-mem
  • sosreport
  • config (shows juju-config)
  • engine-report (shows juju-introspection)

Additional addons can be loaded using --addons-file. Addons files must take the format of:

addon-name:
 # command to run locally (on the machine running juju crashdump),
 # all created files will be pushed to {location} on all units.
 local: echo "example" > example.txt
 # command to run on every unit, all files created in {output} will be saved in the crashdump.
 remote: mv {location}/example.txt {output}/example.txt
 # local command to run for each {unit} or each {machine}. Std output will be saved.
 local-per-unit: echo "example including {unit}"

The commands can appear in any order, any command can be left out, but every command can only be used once.