Improve dump
This commit is contained in:
parent
0e14294c72
commit
01dad9c358
2 changed files with 23 additions and 14 deletions
22
README.md
22
README.md
|
@ -18,21 +18,25 @@ Explore specific entries of a dump:
|
|||
# Useful entries
|
||||
Important note: Depending on the system, some entries may not be available.
|
||||
|
||||
| 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) |
|
||||
| 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 |
|
||||
| declare | Get all shell define variables, functions etc |
|
||||
|
||||
# Notes
|
||||
- To see what is dump look into `sysdump.sh`
|
||||
- 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"
|
||||
- For more infos on what is actually dump see `sysdump.sh`
|
||||
|
||||
|
|
15
sysdump.sh
15
sysdump.sh
|
@ -52,10 +52,8 @@ then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
# Check commands exists
|
||||
# Check commands exist
|
||||
ensure base64
|
||||
ensure date
|
||||
ensure find
|
||||
|
||||
# Start dump
|
||||
echo "{"
|
||||
|
@ -63,6 +61,8 @@ USE_COMMA=1
|
|||
# safecat
|
||||
dump "/etc/nftables.conf" safecat /etc/nftables.conf
|
||||
dump "/etc/group" safecat /etc/group
|
||||
dump "$HOME/.bashrc" safecat $HOME/.bashrc
|
||||
dump "$HOME/.bash_profile" safecat $HOME/.bash_profile
|
||||
dump "/etc/fstab" safecat /etc/fstab
|
||||
dump "/etc/ssh/sshd_config" safecat /etc/ssh/sshd_config
|
||||
dump "/proc/cpuinfo" safecat /proc/cpuinfo
|
||||
|
@ -93,6 +93,7 @@ dump "free" safecmd free -h
|
|||
dump "df" safecmd df -h
|
||||
dump "boot_folder" safecmd ls -R /boot/
|
||||
dump "home_folder" safecmd ls -al ${HOME}
|
||||
dump "root_folder" safecmd ls -al /
|
||||
dump "uid" safecmd id -u
|
||||
dump "gid" safecmd id -g
|
||||
dump "gids" safecmd id -G
|
||||
|
@ -108,17 +109,21 @@ dump "lsmod" safecmd lsmod
|
|||
dump "lspci" safecmd lspci
|
||||
dump "lsirq" safecmd lsirq
|
||||
dump "lsfd" safecmd lsfd
|
||||
dump "root_folder" safecmd ls -al /
|
||||
dump "glxinfo" safecmd glxinfo -B
|
||||
dump "compgen" safecmd compgen -c
|
||||
dump "openssl" safecmd openssl
|
||||
dump "users" safecmd users
|
||||
dump "declare" safecmd declare
|
||||
dump "ping" safecmd ping -c 2 -W 2 4.2.2.2
|
||||
for cmd in bash gcc ld python3 cmake make tar zip gzip bzip2 xz cpio wget rsync curl node pip apt cat systemctl gpg R ruby awk grep sshfs
|
||||
# dump versions
|
||||
for cmd in bash gcc ld python3 cmake make tar zip gzip bzip2 xz cpio wget rsync curl node pip apt cat systemctl gpg R ruby awk grep sshfs docker java
|
||||
do
|
||||
dump "cmd_${cmd}_version" safecmd $cmd --version
|
||||
done
|
||||
dump "cmd_ssh_version" safecmd sshd -V
|
||||
dump "cmd_tmux_version" safecmd tmux -V
|
||||
dump "cmd_nginx_version" safecmd nginx -v
|
||||
dump "cmd_go_version" safecmd go version
|
||||
# safecmdroot
|
||||
dump "dmidecode" safecmdroot dmidecode
|
||||
dump "iptables" safecmdroot iptables -L
|
||||
|
|
Loading…
Add table
Reference in a new issue