X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=grml-hwinfo;h=9b261c198ad94aee8e0effa1dd82f125838940f6;hb=34088327a8f5b5801d891a2014eeb17b6e7ae1e0;hp=cc507861111c4547b5a61e4e4a44f76cc165242a;hpb=442c6fb7be4dbdb1a89862d015e6f1a86ba70a94;p=grml-hwinfo.git diff --git a/grml-hwinfo b/grml-hwinfo index cc50786..9b261c1 100755 --- a/grml-hwinfo +++ b/grml-hwinfo @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Filename: grml-hwinfo # Purpose: get hardware information # Authors: grml-team (grml.org), (c) Michael Prokop @@ -14,7 +14,11 @@ UNAME="$(uname -r)" PN="$(basename $0)" [ -n "$WORKING_DIR" -a -d "$WORKING_DIR" ] || WORKING_DIR=$(pwd) -VERSION='0.4.1' +VERSION='***UNRELEASED***' + +# data collection should not be affected by user locale +export LANG=C +export LC_ALL=C TIMESTAMP='+%F--%H-%M-%S-%Z' DATE="$(date $TIMESTAMP)" @@ -80,7 +84,12 @@ if [ -z "$1" ] ; then echo 'Usage: exectest '>&2 return 1 else - test -e "$(which $1)" && return 0 || return 1 + if test -e "$(which $1)" ; then + return 0 + else + grep -q "^$1"'$' missing_tools 2>/dev/null || echo "$1" >> missing_tools + return 1 + fi fi } @@ -145,6 +154,7 @@ cd "${OUTDIR}" || exit 1 for i in free lsmod mount lsdev ; do exectest $i && $i > $i done + swapon -s > swapon 2>swapon.error # proc stuff for i in cpuinfo interrupts cmdline devices dma fb iomem ioports \ @@ -160,6 +170,7 @@ cd "${OUTDIR}" || exit 1 # hwinfo exectest discover && discover -v --type-summary --enable-bus all > discover 2> discover.2 exectest hwinfo && hwinfo log=hwinfo + exectest numactl && numactl --hardware > numactl exectest x86info && x86info > x86info 2>x86info.2 # net stuff @@ -172,7 +183,6 @@ cd "${OUTDIR}" || exit 1 if exectest dpkg ; then dpkg --get-selections > dpkg_get_selections COLUMNS=300 dpkg --list > dpkg_list - COLUMNS=1000 dpkg -l linux-image-$UNAME | grep linux-image-$UNAME | tr -s ' ' > running_kernel fi # power management @@ -188,6 +198,10 @@ cd "${OUTDIR}" || exit 1 [ -r /boot/config-$UNAME ] && cat /boot/config-$UNAME > kernelconfig fi + exectest dpkg && COLUMNS=1000 dpkg -l linux-image-$UNAME \ + | grep linux-image-$UNAME | tr -s ' ' > running_kernel 2>running_kernel.error + dpkg -S /boot/vmlinuz-$(uname -r) >> running_kernel 2>>running_kernel.error + # X stuff if [ -n "${DISPLAY}" ] ; then exectest xviddetect && xviddetect > xviddetect @@ -215,7 +229,6 @@ else echo "running as root" > root disk_info exectest sfdisk && sfdisk -d > sfdisk 2>sfdisk.error - exectest ddcprobe && ddcprobe > ddcprobe exectest dmidecode && dmidecode > dmidecode exectest dconf && dconf -o dconf @@ -224,16 +237,31 @@ else /usr/share/doc/lm-sensors/examples/eeprom/decode-dimms.pl > decode-dimms 2>decode-dimms.error fi + exectest mdadm && mdadm --detail /dev/md[0-9]* >> mdadm 2>mdadm.error + + # LVM + exectest pvs && pvs > pvs 2>pvs.error + exectest vgs && vgs > vgs 2>vgs.error + exectest lvs && lvs > lvs 2>lvs.error + exectest lvdisplay && lvdisplay > lvdisplay 2>lvdisplay.error + + exectest dmsetup && dmsetup ls > dmsetup_ls 2>dmsetup_ls.error + for disk in $disklist; do exectest smartctl && echo "smartctl -a /dev/$disk :\n" >> smartctl && smartctl -a /dev/$disk >> smartctl && echo "\n\n" >> smartctl exectest hdparm && echo "hdparm -iv /dev/$disk :\n" >> hdparm && hdparm -iv /dev/$disk >> hdparm && echo "\n\n" >> hdparm exectest fdisk && echo "fdisk -lu /dev/$disk :\n" >> fdisk && fdisk -lu /dev/$disk >> fdisk 2>>fdisk.error && echo "\n\n" >> fdisk exectest parted && echo "parted -s /dev/$disk :\n" >> parted && parted -s /dev/$disk print >> parted && echo "\n\n" >> parted - LC_ALL=C file -s /dev/$disk?* | grep -v ": empty" >> file_disk + file -s /dev/$disk?* | grep -v ": empty" >> file_disk done fi ) +# get rid of empty files +for file in *; do + test -s $file || rm $file +done + echo cd "${WORKING_DIR}"