|
1 | 1 | #!/bin/sh |
2 | 2 | # Support utilities for troubleshooting Infix systems |
3 | | - |
4 | | -# Program name for usage messages (supports being renamed by users) |
5 | | -prognm=$(basename "$0") |
6 | | - |
7 | 3 | # |
8 | 4 | # The collect command gathers system information and outputs a tarball. |
9 | 5 | # Data is collected to /var/lib/support (or $HOME as fallback) and then |
10 | 6 | # streamed to stdout. The temporary directory is cleaned up automatically. |
11 | 7 | # |
12 | | -# The following text is primarily intended for users of older Infix |
13 | | -# systems that do not yet have this script in the root fileystems. |
14 | | -# |
15 | | -# 1. Copy this script to the target device's home directory: |
16 | | -# |
17 | | -# scp support user@device: |
18 | | -# |
19 | | -# 2. SSH to the device and make it executable: |
20 | | -# |
21 | | -# ssh user@device chmod +x support |
22 | | -# |
23 | | -# 3. Run the script from your home directory: |
24 | | -# |
25 | | -# ./support collect > support-data.tar.gz |
26 | | -# |
27 | | -# Or directly via SSH from your workstation: |
28 | | -# |
29 | | -# ssh user@device './support collect' > support-data.tar.gz |
30 | | -# |
31 | | -# Optionally, the output can be encrypted with GPG using a password for |
32 | | -# secure transmission to support personnel, see below. |
33 | | -# |
34 | | -# Examples: |
35 | | -# ./support collect > support-data.tar.gz |
36 | | -# ./support collect -s 5 > support-data.tar.gz |
37 | | -# ./support collect -p > support-data.tar.gz.gpg |
38 | | -# ./support collect -p mypass > support-data.tar.gz.gpg |
39 | | -# |
40 | | -# ssh user@device ./support collect > support-data.tar.gz |
41 | | -# ssh user@device ./support collect -p mypass > support-data.tar.gz.gpg |
42 | | -# |
43 | | -# Note, interactive password prompt (-p without argument) may echo characters |
44 | | -# over SSH due to local terminal echo. Use -p PASSWORD for remote execution, |
45 | | -# or pipe the password: echo "password" | ssh user@device ./support collect -p |
46 | | -# meaning you can even: echo "$SECRET_VARIABLE" | ... which in some cases can |
47 | | -# come in handy. |
48 | | -# |
49 | | -# TODO: |
50 | | -# Add more commands, e.g., verify (run health checks), upload <file>, |
51 | | -# test <network|disk|routing>, backup, watch (dashboard view), diff |
| 8 | +# See: 'support help' for more information. |
52 | 9 | # |
| 10 | +# <<< THIS SCRIPT REQUIRES SUDO TO COLLECT RELEVANT LOGS >>> |
| 11 | + |
| 12 | +# Program name for usage messages (supports being renamed by users) |
| 13 | +prognm=$(basename "$0") |
53 | 14 |
|
54 | 15 | cmd_collect() |
55 | 16 | { |
@@ -564,7 +525,7 @@ usage() |
564 | 525 | echo " sudo $prognm collect -p > support-data.tar.gz.gpg" |
565 | 526 | echo " sudo $prognm collect --password mypass > support-data.tar.gz.gpg" |
566 | 527 | echo " sudo $prognm --work-dir /tmp/ram collect > support-data.tar.gz" |
567 | | - echo " ssh user@device 'sudo $prognm collect' > support-data.tar.gz" |
| 528 | + echo " ssh admin@device 'sudo $prognm collect' > support-data.tar.gz" |
568 | 529 | echo " $prognm -u collect > support-data.tar.gz (degraded)" |
569 | 530 | echo " sudo $prognm clean --dry-run" |
570 | 531 | echo " sudo $prognm clean --days 30" |
|
0 commit comments