X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=grml-hwinfo;h=ed48463d5ad658beca16055b5e24599fc42fb3d6;hb=20db99ba6a32968a4d9da529d0b2d9ae138b3397;hp=5f548f523b9efa6f9e67de7408bb56f4715a4400;hpb=a04bc2220ab72a79a4fb82427a67809390db4f24;p=grml-hwinfo.git diff --git a/grml-hwinfo b/grml-hwinfo index 5f548f5..ed48463 100755 --- a/grml-hwinfo +++ b/grml-hwinfo @@ -33,12 +33,11 @@ _opt_output_file=false usage() { echo " - This tool collects information of the hardware this tool is being executed - on. It can be executed as normal user to collect some basic information or - with root permissions to collect as much information as possible. By - default, a file named grml-hwinfo-TIMESTAMP.tar.bz2 storing all collected - information will be created in the current working directory. Alternatively, - you can have it create a directory with all information. + This tool collects information of the hardware it is being executed on. + It can be executed as normal user to collect some basic information or + (recommended) with root permissions to collect more system information. + If executed without any options a file named grml-hwinfo-TIMESTAMP.tar.bz2 + storing all collected information is created in the current working directory. Options: @@ -183,14 +182,12 @@ cd "${OUTDIR}" || exit 1 # disks / devices [ -f /proc/scsi/scsi ] && cat /proc/scsi/scsi > scsi - (lspci; lspci -n) | sort > lspci - [ -r /proc/bus/pnp ] && lspnp > lspnp - [ -r /proc/bus/usb ] && lsusb > lsusb + exectest lspci && lspci -nn > lspci cat /proc/partitions > partitions find /proc/ide/ -name geometry -exec grep . {} \; > proc_ide 2>/dev/null df -h > df 2>/dev/null - for i in free lsmod mount lsdev ; do - exectest $i && $i > $i + for i in free lsmod mount lsdev lspnp lsusb ; do + exectest $i && $i > $i done swapon -s > swapon 2>swapon.error @@ -209,12 +206,26 @@ cd "${OUTDIR}" || exit 1 exectest hwinfo && hwinfo log=hwinfo exectest numactl && numactl --hardware > numactl exectest x86info && x86info > x86info 2>x86info.2 - - # net stuff - exectest ifconfig && ifconfig -v -a > ifconfig - exectest ip && ip route show > ip_route - exectest ip && ip link show > ip_link - exectest route && route -n > route + exectest lscpu && lscpu > lscpu + + # net stuff, net-tools: + exectest ifconfig && ifconfig -v -a > ifconfig + exectest route && route -n > route + + # net stuff, iproute: + exectest ip && ip addrlabel list > ip_addrlabel + exectest ip && ip addr show > ip_addr + exectest ip && ip link show > ip_link + exectest ip && ip maddr show > ip_maddr + exectest ip && ip mroute show > ip_mroute + exectest ip && ip mrule show > ip_mrule + exectest ip && ip neigh show > ip_neigh + exectest ip && ip netns list > ip_netns + exectest ip && ip ntable show > ip_ntable + exectest ip && ip route show > ip_route + exectest ip && ip rule show > ip_rule + exectest ip && ip tunnel show > ip_tunnel + exectest ip && ip tuntap show > ip_tuntap # software if exectest dpkg ; then @@ -224,10 +235,17 @@ cd "${OUTDIR}" || exit 1 # power management exectest laptop-detect && laptop-detect >/dev/null 2>/dev/null && echo "0" > laptop_detected - exectest acpi_available && acpi_available && cat /proc/acpi/info > acpi_info + if [ -r /proc/acpi/info ] ; then + cat /proc/acpi/info > acpi_info + fi + exectest acpi && acpi > acpi 2> acpi.error && acpi -v > acpi.version [ -r /proc/apm/ ] && apm > apm + if exectest mcelog ; then + mcelog > mcelog 2>mcelog.error + fi + # kernel stuff if [ -r /proc/config.gz ] ; then zcat /proc/config.gz > kernelconfig @@ -267,7 +285,18 @@ cd "${OUTDIR}" || exit 1 exectest dconf && dconf -o dconf - if [ -x /usr/share/doc/lm-sensors/examples/eeprom/decode-dimms.pl ] ; then + if exectest mcelog ; then + mcelog --dmi > mcelog_dmi 2>mcelog_dmi.error + fi + + if exectest edac-util ; then + edac-util > edac-util 2>edac-util.error + edac-util --report=full > edac-util_report 2>edac-util_report.error + fi + + if exectest decode-dimms ; then + decode-dimms > decode-dimms 2>decode-dimms.error + elif [ -x /usr/share/doc/lm-sensors/examples/eeprom/decode-dimms.pl ] ; then /usr/share/doc/lm-sensors/examples/eeprom/decode-dimms.pl > decode-dimms 2>decode-dimms.error fi @@ -289,6 +318,23 @@ cd "${OUTDIR}" || exit 1 exectest lvdisplay && lvdisplay > lvdisplay 2>lvdisplay.error exectest dmsetup && dmsetup ls > dmsetup_ls 2>dmsetup_ls.error + exectest dmsetup && dmsetup ls --tree > dmsetup_ls_tree 2>dmsetup_ls_tree.error + exectest lsblk && lsblk > lsblk 2>lsblk.error + + # iSCSI + if exectest iscsiadm ; then + iscsiadm -m session > iscsiadm_session 2>iscsiadm_session.error + iscsiadm -m fw > iscsiadm_fw 2>iscsiadm_fw.error + iscsiadm -m host > iscsiadm_host 2>iscsiadm_host.error + iscsiadm -m iface > iscsiadm_iface 2>iscsiadm_iface.error + iscsiadm -m node > iscsiadm_node 2>iscsiadm_node.error + iscsiadm -m discovery > iscsiadm_discovery 2>iscsiadm_discovery.error + fi + + if exectest lsscsi ; then + lsscsi > lsscsi 2>lsscsi.error + lsscsi -t > lsscsi_transport 2>lsscsi_transport.error + fi for disk in $disklist; do if exectest smartctl ; then @@ -321,13 +367,19 @@ cd "${OUTDIR}" || exit 1 echo -e "\n\n" >> sdparm fi + if exectest sg_inq ; then + echo -e "sg_inq /dev/${disk}:\n" >> sg_inq + sg_inq /dev/$disk >> sg_inq + echo -e "\n\n" >> sg_inq + fi + file -s /dev/$disk?* | grep -v ": empty" >> file_disk done fi ) # get rid of empty files -for file in *; do +for file in *.error ; do test -s $file || rm $file done @@ -337,7 +389,7 @@ cd "${WORKING_DIR}" # create tarball if [ -n "$GENERATE_FILE" ] ; then - tar jcf "${OUTFILE}" "${OUTDIRNAME}" + tar acf "${OUTFILE}" "${OUTDIRNAME}" [ -r "$OUTFILE" ] && echo "$OUTFILE ("$(ls -ahl "$OUTFILE" | awk '{print $5}')") has been generated." fi