2024-07-04 10:36:00 +02:00
|
|
|
# System dump script
|
|
|
|
|
2024-07-04 10:56:42 +02:00
|
|
|
Dump various system informations into base64 encoded values and print them as json.
|
2024-07-04 10:36:00 +02:00
|
|
|
|
|
|
|
# Usage
|
|
|
|
Run a dump:
|
2024-07-04 10:57:29 +02:00
|
|
|
> ./sysdump.sh > dump.json
|
2024-07-04 10:36:31 +02:00
|
|
|
|
2024-07-04 11:05:12 +02:00
|
|
|
Run a dump on a remote machine using ssh:
|
|
|
|
> cat sysdump.sh | ssh user@host /bin/bash > dump.json
|
2024-07-04 11:02:26 +02:00
|
|
|
|
2024-07-05 16:37:36 +02:00
|
|
|
Extra ouput from ssh (e.g: MOTD) will be automatically cleaned by `sysdump.sh`.
|
|
|
|
|
2024-07-05 16:15:28 +02:00
|
|
|
To explore a dump (require `jq`), see help as follow:
|
|
|
|
> ./sysdump.sh -h
|
2024-07-04 12:36:52 +02:00
|
|
|
|
2024-07-04 14:27:19 +02:00
|
|
|
# Useful entries
|
2024-07-04 14:56:18 +02:00
|
|
|
Important note: Depending on the system, some entries may not be available.
|
|
|
|
|
2024-07-05 18:51:57 +02:00
|
|
|
| Entry | Description |
|
|
|
|
|-------------------------|------------------------------------------------------------------|
|
2024-07-06 19:36:08 +02:00
|
|
|
| dump_log | Contains logs of errors happening during a dump |
|
2024-07-05 18:51:57 +02:00
|
|
|
| compgen | List all available commands in current shell |
|
|
|
|
| ping | Check if ping succeed (internet is available) |
|
|
|
|
| boot_folder | Recursive listing of /boot/ |
|
|
|
|
| root_folder | Content of / |
|
2024-07-07 08:50:14 +02:00
|
|
|
| home_\<path\> | List the content of each home directory (at the root only) |
|
2024-07-05 18:51:57 +02:00
|
|
|
| cmd_\<command\>_version | Get the version of some specific commands (e.g: gcc, python etc) |
|
|
|
|
| /proc/cmdline | See kernel parameters |
|
|
|
|
| kernel_config | Get kernel config |
|
|
|
|
| users | List logged users |
|
|
|
|
| declare | Get all shell defined variables, functions etc |
|
2024-07-07 00:23:21 +02:00
|
|
|
| tar_\<path\> | Contains specific files/directory backup (tar archives) |
|
2024-07-04 14:27:37 +02:00
|
|
|
|
2024-07-04 15:47:07 +02:00
|
|
|
# Notes
|
2024-07-05 16:17:24 +02:00
|
|
|
- Some commands require root permissions. If `sysdump.sh` is not run
|
|
|
|
as root, these commands will not be executed and the corresponding
|
|
|
|
entries will not be reported in the dump file.
|
2024-07-07 00:26:03 +02:00
|
|
|
- Be careful, this script backup sensitive data!
|