Last active
May 28, 2019 14:04
-
-
Save kalloc/dca0a279237d3a00bf3e6c7215680fcc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # clean up | |
| rm -rf /tmp/report | |
| (mkdir /tmp/report || (echo "unable to create report dir";exit)) && cd /tmp/report | |
| # system | |
| free -m > free.log | |
| cat /proc/cpuinfo > proc_cpuinfo.log | |
| lspci > lspci.log | |
| # os | |
| mount > mount.log | |
| df -h > df.log | |
| ps aux > psaux.log | |
| find /etc /home /mnt /opt /usr /var > files.log | |
| lsof -n > lsof.log | |
| uptime > uptime.log | |
| lsmod > lsmod.log | |
| cat /proc/cmdline > proc_cmdline.log | |
| uname -a > uname.log | |
| (which lsb_release > /dev/null && lsb_release -a) > lsb_release.log | |
| # network | |
| ifconfig > ifconfig.log | |
| iptables-save > iptables-save.txt | |
| netstat -antup > netstat.log | |
| netstat -r >> netstat.log | |
| netstat -s >> netstat.log | |
| netstat -i >> netstat.log | |
| hostname -A > hostname.log | |
| hostname -I >> hostname.log | |
| # user | |
| cat /etc/passwd > passwd.log | |
| last > last.log | |
| # store | |
| cd /tmp/ | |
| tar zcf /tmp/report.tar.gz -C /tmp/report . | |
| rm -rf /tmp/report | |
| echo Please, send /tmp/report.tar.gz to [email protected] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment