Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ All notable changes to the project are documented in this file.

### Changes

- New `support` command for collecting system diagnostics to aid in both
troubleshooting and support. Run `support collect > data.tar.gz`
locally or remotely via SSH to gather configuration, logs, network state,
and system information
- Upgrade Buildroot to 2025.02.8 (LTS)
- Upgrade Linux kernel to 6.12.59 (LTS)
- Initial support for 32-bit ARM systems, reference board: Raspberry Pi 2B
Expand Down
88 changes: 88 additions & 0 deletions doc/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,94 @@ reference ID, stratum, time offsets, frequency, and root delay.
> The system uses `chronyd` Network Time Protocol (NTP) daemon. The
> output shown here is best explained in the [Chrony documentation][4].

## Support Data Collection

When troubleshooting issues or seeking support, the `support` command
provides a convenient way to collect comprehensive system diagnostics.
This command gathers configuration files, logs, network state, and other
system information into a single compressed archive.

### Collecting Support Data

To collect support data and save it to a file:

```bash
admin@host:~$ support collect > support-data.tar.gz
(admin@host) Password: ***********
Starting support data collection from host...
This may take up to a minute. Please wait...
Tailing /var/log/messages for 30 seconds (please wait)...
Log tail complete.
Collection complete. Creating archive...
admin@host:~$ ls -l support-data.tar.gz
-rw-rw-r-- 1 admin admin 508362 nov 30 13:05 support-data.tar.gz
```

The command can also be run remotely via SSH from your workstation:

```bash
$ ssh admin@host support collect > support-data.tar.gz
...
```

The collection process may take up to a minute depending on system load
and the amount of logging data. Progress messages are shown during the
collection process.

### Encrypted Collection

For secure transmission of support data, the archive can be encrypted
with GPG using a password:

```bash
admin@host:~$ support collect -p mypassword > support-data.tar.gz.gpg
Starting support data collection from host...
This may take up to a minute. Please wait...
...
Collection complete. Creating archive...
Encrypting with GPG...
```

The `support collect` command even supports omitting `mypassword` and
will then prompt interactively for the password. This works over SSH too,
but the local ssh client may then echo the password.

> [!TIP]
> To hide the encryption password for an SSH session, the script supports reading from stdin:
> `echo "$MYSECRET" | ssh user@device support collect -p > file.tar.gz.gpg`

After transferring the resulting file to your workstation, decrypt it
with the password:

```bash
$ gpg -d support-data.tar.gz.gpg > support-data.tar.gz
$ tar xzf support-data.tar.gz
```

or

```bash
$ gpg -d support-data.tar.gz.gpg | tar xz
```

> [!IMPORTANT]
> Make sure to share `mypassword` out-of-band from the encrypted data
> with the recipient of the data. I.e., avoid sending both in the same
> plain-text email for example.

### What is Collected

The support archive includes:

- System identification (hostname, uptime, kernel version)
- Running and operational configuration (sysrepo datastores)
- System logs (`/var/log` directory and live tail of messages log)
- Network configuration and state (interfaces, routes, neighbors, bridges)
- FRRouting information (OSPF, BFD status)
- Container information (podman containers and their configuration)
- System resource usage (CPU, memory, disk, processes)
- Hardware information (PCI, USB devices, network interfaces)

[1]: https://www.rfc-editor.org/rfc/rfc7317
[2]: https://github.com/kernelkit/infix/blob/main/src/confd/yang/infix-system%402024-02-29.yang
[3]: https://www.rfc-editor.org/rfc/rfc8341
Expand Down
1 change: 1 addition & 0 deletions src/bin/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ DISTCLEANFILES = *~ *.d
ACLOCAL_AMFLAGS = -I m4

bin_PROGRAMS = copy erase files
sbin_SCRIPTS = support

# Bash completion
bashcompdir = $(datadir)/bash-completion/completions
Expand Down
Loading