• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
22echo "Hardware Information for `hostname` at `date`."
23if [ "$UID" -ne 0 ]; then
24	echo "You are not running as root.  Hardware data may be restricted."
25fi
26echo
27echo "dmesg output:"
28echo "============="
29dmesg
30echo
31echo "/proc/cmdline:"
32echo "=============="
33cat /proc/cmdline
34echo
35echo "CPU Information:"
36echo "================"
37cat /proc/cpuinfo
38echo
39echo "DMI Table Dump:"
40echo "==============="
41dmidecode
42echo
43echo "Registered Devices:"
44echo "==================="
45cat /proc/devices
46echo
47echo "Registered DMA Channels:"
48echo "========================"
49cat /proc/dma
50echo
51echo "Registered Interrupts:"
52echo "======================"
53cat /proc/interrupts
54echo
55echo "IO Memory:"
56echo "=========="
57cat /proc/iomem
58echo
59echo "IO Ports:"
60echo "========="
61cat /proc/ioports
62echo
63echo "PCI Device Tree via lspci:"
64echo "=========================="
65lspci -v
66echo
67echo "IDE Device/Driver Info:"
68echo "======================="
69find /proc/ide -type f | while read f; do echo $f; cat $f; done;
70echo
71echo "SCSI Device/Driver Info:"
72echo "========================"
73find /proc/scsi -type f | while read f; do echo $f; cat $f; done;
74echo
75echo "Network Devices:"
76echo "================"
77ifconfig -a
78echo
79echo "Partition Layout:"
80echo "================="
81fdisk -l /dev/sd[a-z] /dev/hd[a-z]
82echo
83echo "sysfs Device Info:"
84echo "=================="
85find /sys -mount -type f | while read f; do echo $f: `cat $f`; done
86
87exit 0
88