Home | History | Annotate | Download | only in test_scripts
      1 #!/bin/bash
      2 
      3 # Script to collect hardware information
      4 
      5 # Copyright (C) 2003-2006 IBM
      6 #
      7 # This program is free software; you can redistribute it and/or
      8 # modify it under the terms of the GNU General Public License as
      9 # published by the Free Software Foundation; either version 2 of the
     10 # License, or (at your option) any later version.
     11 #
     12 # This program is distributed in the hope that it will be useful, but
     13 # WITHOUT ANY WARRANTY; without even the implied warranty of
     14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     15 # General Public License for more details.
     16 #
     17 # You should have received a copy of the GNU General Public License
     18 # along with this program; if not, write to the Free Software
     19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
     20 # 02111-1307, USA.
     21 
     22 echo "Hardware Information for `hostname` at `date`."
     23 if [ "$UID" -ne 0 ]; then
     24 	echo "You are not running as root.  Hardware data may be restricted."
     25 fi
     26 echo
     27 echo "dmesg output:"
     28 echo "============="
     29 dmesg
     30 echo
     31 echo "/proc/cmdline:"
     32 echo "=============="
     33 cat /proc/cmdline
     34 echo
     35 echo "CPU Information:"
     36 echo "================"
     37 cat /proc/cpuinfo
     38 echo
     39 echo "DMI Table Dump:"
     40 echo "==============="
     41 dmidecode
     42 echo
     43 echo "Registered Devices:"
     44 echo "==================="
     45 cat /proc/devices
     46 echo
     47 echo "Registered DMA Channels:"
     48 echo "========================"
     49 cat /proc/dma
     50 echo
     51 echo "Registered Interrupts:"
     52 echo "======================"
     53 cat /proc/interrupts
     54 echo
     55 echo "IO Memory:"
     56 echo "=========="
     57 cat /proc/iomem
     58 echo
     59 echo "IO Ports:"
     60 echo "========="
     61 cat /proc/ioports
     62 echo
     63 echo "PCI Device Tree via lspci:"
     64 echo "=========================="
     65 lspci -v
     66 echo
     67 echo "IDE Device/Driver Info:"
     68 echo "======================="
     69 find /proc/ide -type f | while read f; do echo $f; cat $f; done;
     70 echo
     71 echo "SCSI Device/Driver Info:"
     72 echo "========================"
     73 find /proc/scsi -type f | while read f; do echo $f; cat $f; done;
     74 echo
     75 echo "Network Devices:"
     76 echo "================"
     77 ifconfig -a
     78 echo
     79 echo "Partition Layout:"
     80 echo "================="
     81 fdisk -l /dev/sd[a-z] /dev/hd[a-z]
     82 echo
     83 echo "sysfs Device Info:"
     84 echo "=================="
     85 find /sys -mount -type f | while read f; do echo $f: `cat $f`; done
     86 
     87 exit 0
     88