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
|
# Useful entries
|
||||||
Important note: Depending on the system, some entries may not be available.
|
Important note: Depending on the system, some entries may not be available.
|
||||||
|
|
||||||
| Entry | Description |
|
| Entry | Description |
|
||||||
|-------------------------|------------------------------------------------------------------|
|
|--------------------------|------------------------------------------------------------------|
|
||||||
| compgen | List all available commands in current shell |
|
| compgen | List all available commands in current shell |
|
||||||
| ping | Check if ping succeed (internet is available) |
|
| ping | Check if ping succeed (internet is available) |
|
||||||
| boot_folder | Recursive listing of /boot/ |
|
| boot_folder | Recursive listing of /boot/ |
|
||||||
| root_folder | Content of / |
|
| root_folder | Content of / |
|
||||||
| home_folder | Content of $HOME |
|
| home_folder | Content of $HOME |
|
||||||
| cmd_\<command\>_version | Get the version of some specific commands (e.g: gcc, python etc) |
|
| 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
|
# Notes
|
||||||
- To see what is dump look into `sysdump.sh`
|
|
||||||
- Some commands require root permissions.
|
- Some commands require root permissions.
|
||||||
If `sysdump.sh` is not run as root, these commands will not be executed.
|
If `sysdump.sh` is not run as root, these commands will not be executed.
|
||||||
- List available entries:
|
- List available entries:
|
||||||
> cat dump.json |grep -o ".*:"
|
> cat dump.json |grep -o ".*:"
|
||||||
- List available command versions:
|
- List available command versions:
|
||||||
> cat dump.json |grep -o "cmd_.*_version"
|
> 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
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check commands exists
|
# Check commands exist
|
||||||
ensure base64
|
ensure base64
|
||||||
ensure date
|
|
||||||
ensure find
|
|
||||||
|
|
||||||
# Start dump
|
# Start dump
|
||||||
echo "{"
|
echo "{"
|
||||||
|
@ -63,6 +61,8 @@ USE_COMMA=1
|
||||||
# safecat
|
# safecat
|
||||||
dump "/etc/nftables.conf" safecat /etc/nftables.conf
|
dump "/etc/nftables.conf" safecat /etc/nftables.conf
|
||||||
dump "/etc/group" safecat /etc/group
|
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/fstab" safecat /etc/fstab
|
||||||
dump "/etc/ssh/sshd_config" safecat /etc/ssh/sshd_config
|
dump "/etc/ssh/sshd_config" safecat /etc/ssh/sshd_config
|
||||||
dump "/proc/cpuinfo" safecat /proc/cpuinfo
|
dump "/proc/cpuinfo" safecat /proc/cpuinfo
|
||||||
|
@ -93,6 +93,7 @@ dump "free" safecmd free -h
|
||||||
dump "df" safecmd df -h
|
dump "df" safecmd df -h
|
||||||
dump "boot_folder" safecmd ls -R /boot/
|
dump "boot_folder" safecmd ls -R /boot/
|
||||||
dump "home_folder" safecmd ls -al ${HOME}
|
dump "home_folder" safecmd ls -al ${HOME}
|
||||||
|
dump "root_folder" safecmd ls -al /
|
||||||
dump "uid" safecmd id -u
|
dump "uid" safecmd id -u
|
||||||
dump "gid" safecmd id -g
|
dump "gid" safecmd id -g
|
||||||
dump "gids" safecmd id -G
|
dump "gids" safecmd id -G
|
||||||
|
@ -108,17 +109,21 @@ dump "lsmod" safecmd lsmod
|
||||||
dump "lspci" safecmd lspci
|
dump "lspci" safecmd lspci
|
||||||
dump "lsirq" safecmd lsirq
|
dump "lsirq" safecmd lsirq
|
||||||
dump "lsfd" safecmd lsfd
|
dump "lsfd" safecmd lsfd
|
||||||
dump "root_folder" safecmd ls -al /
|
|
||||||
dump "glxinfo" safecmd glxinfo -B
|
dump "glxinfo" safecmd glxinfo -B
|
||||||
dump "compgen" safecmd compgen -c
|
dump "compgen" safecmd compgen -c
|
||||||
dump "openssl" safecmd openssl
|
dump "openssl" safecmd openssl
|
||||||
|
dump "users" safecmd users
|
||||||
|
dump "declare" safecmd declare
|
||||||
dump "ping" safecmd ping -c 2 -W 2 4.2.2.2
|
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
|
do
|
||||||
dump "cmd_${cmd}_version" safecmd $cmd --version
|
dump "cmd_${cmd}_version" safecmd $cmd --version
|
||||||
done
|
done
|
||||||
dump "cmd_ssh_version" safecmd sshd -V
|
dump "cmd_ssh_version" safecmd sshd -V
|
||||||
dump "cmd_tmux_version" safecmd tmux -V
|
dump "cmd_tmux_version" safecmd tmux -V
|
||||||
|
dump "cmd_nginx_version" safecmd nginx -v
|
||||||
|
dump "cmd_go_version" safecmd go version
|
||||||
# safecmdroot
|
# safecmdroot
|
||||||
dump "dmidecode" safecmdroot dmidecode
|
dump "dmidecode" safecmdroot dmidecode
|
||||||
dump "iptables" safecmdroot iptables -L
|
dump "iptables" safecmdroot iptables -L
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue