#!/bin/sh # (calls sh, but needs bash) # # sysinfo-collect # # Gather some system information and store in gziped tar file. # # Copyright (C) by Volker Kuhlmann # Released under the terms of the GNU General Public License (GPL) Version 2. # See http://www.gnu.org/ for details. # # Volker Kuhlmann # 23 Jun; 2 Jul 2003 # 14 Jan; 9, 19 Dec 2004 # 12 Feb 2005 updated, renamed from sysinfo to sysinfo-collect # 3, 14 Mar 2006 # # working directory wd=/tmp/sysinfo-dir # files to save from /proc (must be copied first) saveproc=( apm cmdline cpufreq cpuinfo crypto devices dma filesystems ide/drivers ide/ide?/hd?/* ide/piix interrupts iomem ioports isapnp mdstat meminfo misc modules mounts partitions pci scsi/scsi swaps version ) set -x unset LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME wd="$wd/sysinfo" mkdir -p $wd || exit 9 cd $wd || exit 9 fdisk -l >fdisk fdisk -lu >fdisk-u lspci >lspci lspci -n >lspci-n lspci -vv >lspci-vv lsusb >lsusb lsusb -v >lsusb-v if type -p lsscsi >/dev/null; then lsscsi -lvg >lsscsi-lvg lsscsi -g >lsscsi-g else echo "No command lsscsi!" fi mount >mount df -k >df free >free uname -a >uname-a setserial -ag /dev/ttyS[0-7] >serial rpm -qa | sort >rpms cp /etc/*release . cp -p /etc/*release . cp $0 "`basename $0`".sh cp -p $0 "`basename $0`".sh cd /proc rm -rf "$wd/proc" mkdir -p $wd/proc for file in ${saveproc[@]}; do test -e "$file" || continue test "${file%/*}" != "$file" && mkdir -p "$wd/proc/${file%/*}" cp -p "$file" "$wd/proc/$file" done cd $wd type -p dmidecode >/dev/null && dmidecode >dmidecode hwinfo >hwinfo cd $wd/.. export GZIP=-9 tar -czf sysinfo.tar.gz sysinfo echo "System info saved in: `pwd`/sysinfo.tar.gz"