Support lscpu, lsblk and dmsetup ls --tree
[grml-hwinfo.git] / grml-hwinfo
index c5bbd8d..0780e8b 100755 (executable)
@@ -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:
 
@@ -207,6 +206,7 @@ cd "${OUTDIR}" || exit 1
   exectest hwinfo   && hwinfo log=hwinfo
   exectest numactl  && numactl --hardware > numactl
   exectest x86info  && x86info > x86info 2>x86info.2
+  exectest lscpu    && lscpu > lscpu
 
   # net stuff
   exectest ifconfig  && ifconfig -v -a  > ifconfig
@@ -287,6 +287,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
@@ -335,7 +352,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