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-04 17:04:32 +02:00
|
|
|
| Entry | Description |
|
|
|
|
|--------------------------|------------------------------------------------------------------|
|
|
|
|
| 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 / |
|
|
|
|
| home_folder | Content of $HOME |
|
|
|
|
| cmd_\<command\>_version | Get the version of some specific commands (e.g: gcc, python etc) |
|
|
|
|
| /proc/cmdline | See kernel parameters |
|
|
|
|
| /boot/config-$(uname -r) | Get kernel config |
|
|
|
|
| users | List logged users |
|
2024-07-04 17:06:12 +02:00
|
|
|
| declare | Get all shell defined variables, functions etc |
|
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-04 14:27:19 +02:00
|
|
|
|