sysdump.sh/README.md

43 lines
1.9 KiB
Markdown
Raw Normal View History

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-04 12:14:29 +02:00
Explore a dump (require `jq`):
2024-07-04 10:36:00 +02:00
> ./sysdump.sh dump.json
2024-07-04 12:12:34 +02:00
2024-07-04 12:14:29 +02:00
Explore specific entries of a dump:
2024-07-04 12:12:34 +02:00
> ./sysdump.sh dump.json uname timezone
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
- Some commands require root permissions.
If `sysdump.sh` is not run as root, these commands will not be executed.
- List available entries:
> cat dump.json |grep -o ".*:"
- List available command versions:
> cat dump.json |grep -o "cmd_.*_version"
2024-07-04 17:04:32 +02:00
- For more infos on what is actually dump see `sysdump.sh`
2024-07-04 14:27:19 +02:00