@oldfred: I noticed that this morning and had already corrected it.
I just reran it on the Test machine and here is "current"...
Script:
Code:
#!/bin/bash
## MAFoElffen, <mafoelffen@ubuntu.com>, 2021.08.19
## Version 01.01, 2021.08.20
## Includes recommended changes submitted by:
## sudodus <nio.wiklund@gmail.com>, 2021.08.20
## oldfred, 2021.08.20
## Filename: Report-01.01.sh
## Description: Report Finds Machine Hardware Related Information.
## For support use at "UbuntuForums.org".
## Check if ran as root
if [[ "$EUID" == 0 ]]
then echo "This script cannot be run as root"
exit
fi
## Set filename and path to
report="$HOME/Report.txt"
## Set locale settings
LANG=C
## Set a pretty screen decoration for displaying the report onscreen
blueback="\0033[1;37;44m"
resetvid="\0033[0m"
## Check for preinstalled prerequisites
REQUIRED=$(apt list --installed | grep inxi 2> /dev/null)
SUB1="installed"
boot_mode=$( [ -d /sys/firmware/efi ] && echo "UEFI mode" || echo "Legacy mode (alias CSM alias BIOS mode)" )
echo "This script will install any prerequisite packages..." # The LiveCD has this preinstalled
if [[ $REQUIRED == *"$SUB1"* ]]; then
continue;
else
sudo add-apt-repository universe
sudo apt install -y inxi;
fi
# User Input for Computer Make, Model, Type.
clear
echo -e "Please provide some \"Basic Information\"..."
#read -p "Computer Make (ie: Dell/HP/ASUS/Lenova): " computer_make
#read -p "Computer Model (ie: Ultima 420p) " computer_model
#read -p "Computer Type (ie: Server | Desktop | Laptop): " computer_type
read -p "What is the main complaint (summarized)? " main_complaint
read -p "Describe the Problem: " problem_description
clear
# Machine Info
echo -e "Starting Report: `date +%F` `date +%T`" > $report
echo -e "" >> $report
echo -e "${blueback}---------- User Input:$resetvid" >> $report
#echo -e "Computer Make: $computer_make" >> $report
#echo -e "Computer Model: $computer_model" >> $report
#echo -e "Computer Type: $computer_type" >> $report
echo -e "" >> $report
echo -e "Main Complaint: $main_complaint" >> $report
echo -e "Problem Description: $problem_description" >> $report
echo -e "" >> $report
echo -e "${blueback}---------- General computers specs from 'lshw':$resetvid" >> $report
sudo bash -c "lshw | sed '/*-core/,$ d'" >> $report
clear
echo -e "" >> $report
echo -e "${blueback}---------- General computers specs from 'inxi':$resetvid" >> $report
sudo bash -c "inxi -CDGimMoprS | grep -v 'loop\|snap'" >> $report
clear
echo -e "${blueback}---------- File System Disk Space Usage:$resetvid" >> $report
bash -c "df -h | grep -v 'loop\|snap'" >> $report
echo -e "" >> $report
echo -e "" >> $report
echo -e "${blueback}---------- Additional Disk/Partition Information:$resetvid" >> $report
echo -e "${blueback}---------- Information From 'fdisk':$resetvid" >> $report
sudo bash -c "fdisk -l | grep 'Disk\|Device\|/dev/' | grep -v 'loop\|snap'" >> $report
echo -e "" >> $report
echo -e "${blueback}---------- Information From 'lsblk':$resetvid" >> $report
bash -c "lsblk -o NAME,SIZE,FSTYPE,LABEL,MOUNTPOINT,MODEL | grep -v 'loop\|snap'" >> $report
echo -e " ------- 'lsblk' information continued..." >> $report
bash -c "lsblk -o NAME,PARTUUID,UUID | grep -v loop" >> $report
echo -e "${blueback}---------- Mount Details of '/etc/fstab':$resetvid" >> $report
bash -c "egrep -v '#' /etc/fstab" >> $report
echo -e "" >> $report
echo -e "${blueback}---------- Video Details:$resetvid" >> $report
sudo bash -c "lshw -C video" >> $report
clear
echo -e "" >> $report
echo -e "${blueback}---------- Other Details:$resetvid" >> $report
echo -e "The computer boot mode was: $boot_mode" >> $report
echo -e "The current kernel version is: `uname -r`" >> $report
echo -e "The current release description is: `lsb_release -sd`" >> $report
echo -e "" >> $report
echo -e "The current logged in User is: `who`" >> $report
echo -e "" >> $report
echo -e "The User\'s ID is: `id`" >> $report
echo -e "" >> $report
echo -e "The current running DE is: $XDG_CURRENT_DESKTOP" >> $report
echo -e "" >> $report
echo -e "*** End Of Report ***" >> $report
echo -e "" >> $report
echo -e "The Report can be found at $report, and can be viewed with"
echo -e ""
echo -e ""
less -r $report
## Post-Process Report.txt to remove the extraneous ANSI characters sequences from the report text...
perl -i -pe 's/\x1b\[[0-9;]*[mG]//g' $report
#sed -i 's/\x1b\[[0-9;]*[mG]//g' $report
Sample Report Output:
Code:
Starting Report: 2021-08-21 21:38:23
---------- User Input:
Main Complaint: TestA
Problem Description: TesTB
---------- General computers specs from 'lshw':
ubuntu-micro
description: Computer
product: Standard PC (Q35 + ICH9, 2009)
vendor: QEMU
version: pc-q35-4.2
width: 64 bits
capabilities: smbios-2.8 dmi-2.8 smp vsyscall32
configuration: boot=normal uuid=F231A073-CB54-0D41-A673-D7CAB96ED04A
---------- General computers specs from 'inxi':
System: Host: ubuntu-micro Kernel: 5.11.0-27-generic x86_64 bits: 64 Console: N/A
Distro: Ubuntu 20.04.3 LTS (Focal Fossa)
Machine: Type: Kvm System: QEMU product: Standard PC (Q35 + ICH9, 2009) v: pc-q35-4.2 serial: N/A
Mobo: N/A model: N/A serial: N/A UEFI: EFI Development Kit II / OVMF v: 0.0.0 date: 02/06/2015
Memory: RAM: total: 3.82 GiB used: 237.4 MiB (6.1%)
Array-1: capacity: 4 GiB slots: 1 EC: Multi-bit ECC
Device-1: DIMM 0 size: 4 GiB speed: Unknown
CPU: Topology: 4x Single Core model: AMD Opteron 63xx class CPU bits: 64 type: SMP L2 cache: 2048 KiB
Speed: 2800 MHz min/max: N/A Core speeds (MHz): 1: 2800 2: 2800 3: 2800 4: 2800
Graphics: Device-1: Red Hat QXL paravirtual graphic card driver: qxl v: kernel
Display: server: X.org 1.20.11 driver: qxl tty: 128x48
Message: Advanced graphics data unavailable in console for root.
Network: Device-1: Red Hat Virtio network driver: virtio-pci
IF-ID-1: enp1s0 state: up speed: -1 duplex: unknown mac: 52:54:00:9d:48:42
IP v4: 192.168.122.136/24 type: dynamic scope: global
IP v6: fe80::5054:ff:fe9d:4842/64 scope: link
WAN IP: 76.22.108.221
Drives: Local Storage: total: 85.00 GiB used: 8.24 GiB (9.7%)
ID-1: /dev/sda vendor: QEMU model: HARDDISK size: 10.00 GiB
ID-2: /dev/sdb vendor: QEMU model: HARDDISK size: 20.00 GiB
ID-3: /dev/sdc vendor: QEMU model: HARDDISK size: 20.00 GiB
ID-4: /dev/sdd vendor: QEMU model: HARDDISK size: 20.00 GiB
ID-5: /dev/vda model: N/A size: 15.00 GiB
Partition: ID-1: / size: 14.21 GiB used: 8.24 GiB (58.0%) fs: ext4 dev: /dev/vda2
ID-2: /boot/efi size: 511.0 MiB used: 5.2 MiB (1.0%) fs: vfat dev: /dev/vda1
Unmounted: ID-1: /dev/dm-0 size: 8.54 GiB fs: ext4 label: N/A uuid: ddf2288c-015c-4a63-aaf9-241973331647
ID-2: /dev/dm-1 size: 980.0 MiB fs: swap label: N/A uuid: 6ee48abe-b40d-4ac6-bd9d-22247d0f714a
ID-3: /dev/dm-2 size: 9.23 GiB fs: ext4 label: N/A uuid: fb81d8c7-1804-43cd-88c4-d6ef38419efb
ID-4: /dev/sda1 size: 512.0 MiB fs: vfat label: N/A uuid: 0576-559D
ID-5: /dev/sda2 size: 9.50 GiB fs: lvm2_member label: N/A uuid: L9rK0Q-RDec-QdUw-U6z2-8fGK-tkcr-PcTVg3
ID-6: /dev/sdb1 size: 512.0 MiB fs: vfat label: N/A uuid: 5500-DEE3
ID-7: /dev/sdb2 size: 923.0 MiB fs: swap label: N/A uuid: e7b1408b-c301-4044-a60b-2437c539d83e
ID-8: /dev/sdb3 size: 998.0 MiB fs: zfs_member label: bpool uuid: 7959111764556978840
ID-9: /dev/sdb4 size: 17.62 GiB fs: zfs_member label: rpool uuid: 6089464218371032509
ID-10: /dev/sdc1 size: 5.0 MiB fs: btrfs label: N/A uuid: a8fb8883-4130-415d-9488-3bedf7649187
ID-11: /dev/sdc2 size: 2.30 GiB fs: swap label: N/A uuid: 35238d3a-a2f6-411b-827f-7c5945919076
ID-12: /dev/sdc3 size: 499.7 MiB fs: vfat label: N/A uuid: 5805-E4A0
ID-13: /dev/sdc4 size: 17.20 GiB fs: btrfs label: N/A uuid: 9f292e4e-9582-450f-a9c6-f07cfa7e3b1f
ID-14: /dev/sdd1 size: 512.0 MiB fs: vfat label: N/A uuid: BFCD-815C
ID-15: /dev/sdd2 size: 1024.0 MiB fs: ext4 label: N/A uuid: 3ba41e8e-0387-46e5-9d3d-7931f44e604c
ID-16: /dev/sdd3 size: 4.62 GiB fs: ext4 label: N/A uuid: ea473298-3e83-49f9-a1a6-b1e8bd9541cd
Repos: Active apt repos in: /etc/apt/sources.list
1: deb http://us.archive.ubuntu.com/ubuntu focal main restricted
2: deb http://us.archive.ubuntu.com/ubuntu focal-updates main restricted
3: deb http://us.archive.ubuntu.com/ubuntu focal universe
4: deb http://us.archive.ubuntu.com/ubuntu focal-updates universe
5: deb http://us.archive.ubuntu.com/ubuntu focal multiverse
6: deb http://us.archive.ubuntu.com/ubuntu focal-updates multiverse
7: deb http://us.archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
8: deb http://us.archive.ubuntu.com/ubuntu focal-security main restricted
9: deb http://us.archive.ubuntu.com/ubuntu focal-security universe
10: deb http://us.archive.ubuntu.com/ubuntu focal-security multiverse
11: deb http://ppa.launchpad.net/nemh/systemback/ubuntu xenial main
Active apt repos in: /etc/apt/sources.list.d/scootersoftware.list
1: deb https://www.scootersoftware.com/ bcompare4 non-free
Active apt repos in: /etc/apt/sources.list.d/sublime-text.list
1: deb https://download.sublimetext.com/ apt/stable/
---------- File System Disk Space Usage:
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 392M 1.8M 390M 1% /run
/dev/vda2 15G 8.3G 5.3G 62% /
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/vda1 511M 5.3M 506M 2% /boot/efi
tmpfs 392M 0 392M 0% /run/user/1000
---------- Additional Disk/Partition Information:
---------- Information From 'fdisk':
Disk /dev/vda: 15 GiB, 16106127360 bytes, 31457280 sectors
Disklabel type: gpt
Disk identifier: DAC0F0EB-AB2F-4964-A77B-AE44A7CF90AA
Device Start End Sectors Size Type
/dev/vda1 2048 1050623 1048576 512M EFI System
/dev/vda2 1050624 31455231 30404608 14.5G Linux filesystem
Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: QEMU HARDDISK
Disklabel type: gpt
Disk identifier: 58BB9F90-8E99-4E50-8E0D-99450436AA74
Device Start End Sectors Size Type
/dev/sdb1 2048 1050623 1048576 512M EFI System
/dev/sdb2 1050624 2940927 1890304 923M Linux swap
/dev/sdb3 2940928 4984831 2043904 998M Solaris boot
/dev/sdb4 4984832 41943006 36958175 17.6G Solaris root
Disk /dev/sda: 10 GiB, 10737418240 bytes, 20971520 sectors
Disk model: QEMU HARDDISK
Disklabel type: gpt
Disk identifier: A9B3437B-32F9-41FE-A10C-F421EF6AC138
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 20969471 19918848 9.5G Linux LVM
Disk /dev/sdd: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: QEMU HARDDISK
Disklabel type: gpt
Disk identifier: B2EC33ED-9E86-4F3C-8D4F-09F1626C54E2
Device Start End Sectors Size Type
/dev/sdd1 2048 1050623 1048576 512M EFI System
/dev/sdd2 1050624 3147775 2097152 1G Linux filesystem
/dev/sdd3 3147776 12843007 9695232 4.6G Linux filesystem
/dev/sdd4 12843008 22538239 9695232 4.6G Linux filesystem
/dev/sdd5 22538240 32233471 9695232 4.6G Linux filesystem
/dev/sdd6 32233472 41928703 9695232 4.6G Linux filesystem
Disk /dev/sdc: 20 GiB, 21474836480 bytes, 41943040 sectors
Disk model: QEMU HARDDISK
Disklabel type: gpt
Disk identifier: FC18B045-AAF9-40F7-A168-EAF0ACFE2FF7
Device Start End Sectors Size Type
/dev/sdc1 2048 12287 10240 5M BIOS boot
/dev/sdc2 37109760 41940991 4831232 2.3G Linux swap
/dev/sdc3 12288 1035724 1023437 499.7M EFI System
/dev/sdc4 1036288 37109759 36073472 17.2G Linux filesystem
Disk /dev/md0: 9.24 GiB, 9917431808 bytes, 19369984 sectors
Disk /dev/mapper/vgubuntu-root: 8.55 GiB, 9168748544 bytes, 17907712 sectors
Disk /dev/mapper/vgubuntu-swap_1: 980 MiB, 1027604480 bytes, 2007040 sectors
Disk /dev/mapper/vg0-lv--0: 9.24 GiB, 9915334656 bytes, 19365888 sectors
---------- Information From 'lsblk':
NAME SIZE FSTYPE LABEL MOUNTPOINT MODEL
sda 10G QEMU_HARDDISK
|-sda1 512M vfat
`-sda2 9.5G LVM2_member
|-vgubuntu-root 8.6G ext4
`-vgubuntu-swap_1 980M swap
sdb 20G zfs_member rpool QEMU_HARDDISK
|-sdb1 512M vfat
|-sdb2 923M swap
|-sdb3 998M zfs_member bpool
`-sdb4 17.6G zfs_member rpool
sdc 20G QEMU_HARDDISK
|-sdc1 5M btrfs
|-sdc2 2.3G swap
|-sdc3 499.7M vfat
`-sdc4 17.2G btrfs
sdd 20G QEMU_HARDDISK
|-sdd1 512M vfat
|-sdd2 1G ext4
|-sdd3 4.6G ext4
|-sdd4 4.6G linux_raid_member ubuntu-server:0
| `-md0 9.2G LVM2_member
| `-vg0-lv--0 9.2G ext4
|-sdd5 4.6G linux_raid_member ubuntu-server:0
| `-md0 9.2G LVM2_member
| `-vg0-lv--0 9.2G ext4
`-sdd6 4.6G linux_raid_member ubuntu-server:0
`-md0 9.2G LVM2_member
`-vg0-lv--0 9.2G ext4
sr0 1024M QEMU_DVD-ROM
vda 15G
|-vda1 512M vfat /boot/efi
`-vda2 14.5G ext4 /
------- 'lsblk' information continued...
NAME PARTUUID UUID
sda
|-sda1 0d0795b9-8647-4870-abf2-9aafc0e5a216 0576-559D
`-sda2 265d21f0-139c-41f0-8fa0-873dd08c60d7 L9rK0Q-RDec-QdUw-U6z2-8fGK-tkcr-PcTVg3
|-vgubuntu-root ddf2288c-015c-4a63-aaf9-241973331647
`-vgubuntu-swap_1 6ee48abe-b40d-4ac6-bd9d-22247d0f714a
sdb 6089464218371032509
|-sdb1 6e211de1-463c-4e07-8005-430c80d03a0b 5500-DEE3
|-sdb2 498cd4aa-5e15-784b-8cb6-81b36f2464c1 e7b1408b-c301-4044-a60b-2437c539d83e
|-sdb3 0dc16314-a3be-e441-92c3-9552c589b167 7959111764556978840
`-sdb4 e2d1b433-d043-df44-bc3e-6fcf7e2054b4 6089464218371032509
sdc
|-sdc1 c60dc45a-3d5a-4670-a26f-9ade07729429 a8fb8883-4130-415d-9488-3bedf7649187
|-sdc2 ad9a6f28-3f97-4d39-80db-a7a5b5d8e5b8 35238d3a-a2f6-411b-827f-7c5945919076
|-sdc3 a2f12bfa-8f33-437d-855b-48f895b51fce 5805-E4A0
`-sdc4 6bc67035-ff67-4965-92d7-adc56c4910e9 9f292e4e-9582-450f-a9c6-f07cfa7e3b1f
sdd
|-sdd1 a335de55-ce88-4cc3-90ed-2ee84daa04fd BFCD-815C
|-sdd2 c8068219-fb37-4553-a0f2-8a9c9fa666c2 3ba41e8e-0387-46e5-9d3d-7931f44e604c
|-sdd3 8b471189-1646-40f5-b4ef-94be12dd8dca ea473298-3e83-49f9-a1a6-b1e8bd9541cd
|-sdd4 e60ba893-2468-4860-b844-1ac2c4b57fbe d6832d54-1467-5d39-c3fa-64220b04592b
| `-md0 49A1jd-pEUU-rLYa-XfeD-Y7Ws-8FHk-miK2lv
| `-vg0-lv--0 fb81d8c7-1804-43cd-88c4-d6ef38419efb
|-sdd5 3a6f2c09-fdd4-4bf3-89f5-2826f8305dbc d6832d54-1467-5d39-c3fa-64220b04592b
| `-md0 49A1jd-pEUU-rLYa-XfeD-Y7Ws-8FHk-miK2lv
| `-vg0-lv--0 fb81d8c7-1804-43cd-88c4-d6ef38419efb
`-sdd6 afdf78af-55b5-490c-9741-1191a4c82f34 d6832d54-1467-5d39-c3fa-64220b04592b
`-md0 49A1jd-pEUU-rLYa-XfeD-Y7Ws-8FHk-miK2lv
`-vg0-lv--0 fb81d8c7-1804-43cd-88c4-d6ef38419efb
sr0
vda
|-vda1 02e2f394-168a-4f59-85dc-21f9e9e3a650 E615-315B
`-vda2 9486f3ff-d547-4fe1-9c04-4ace8597fa17 0f0bfec7-d134-4a5a-bca9-f07e3c91badb
---------- Mount Details of '/etc/fstab':
/dev/disk/by-uuid/0f0bfec7-d134-4a5a-bca9-f07e3c91badb / ext4 defaults 0 0
/dev/disk/by-uuid/E615-315B /boot/efi vfat defaults 0 0
/swap.img none swap sw 0 0
---------- Video Details:
*-display
description: VGA compatible controller
product: QXL paravirtual graphic card
vendor: Red Hat, Inc.
physical id: 1
bus info: pci@0000:00:01.0
version: 04
width: 32 bits
clock: 33MHz
capabilities: vga_controller bus_master rom
configuration: driver=qxl latency=0
resources: irq:21 memory:c4000000-c7ffffff memory:c0000000-c3ffffff memory:c8c84000-c8c85fff ioport:1040(size=32) memory:c0000-dffff
---------- Other Details:
The computer boot mode was: UEFI mode
The current kernel version is: 5.11.0-27-generic
The current release description is: Ubuntu 20.04.3 LTS
The current logged in User is: ubuntu tty1 Aug 20 22:50
The User\'s ID is: uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lxd),121(libvirt)
The current running DE is:
*** End Of Report ***
NOTE: That the TestVM is the current Support LiveCD system, with 4 test disks attached to it for testing... It boots as Console and has a minimal X on-demand desktop... Since it is on-demand and not permanent confgured in XDG, the $XDG_CURRENT_DESKTOP never gets set... I think that is still okay, because a normal user will not be running Graphics Layer as on-demand. Or should I show $DESKTOP_SESSION? Except, that it doesn't seem to matter if running X on-demand... That variable doesn't populate on X on-demand either... LOL
If it you do think that is important, I can change that using
Code:
desktop_list="gnome|metacity|ubuntu|lxde|mate|kde|openbox" # <--- and keep adding desktop types
bash -c ( ps -e | grep tty | grep -i '$desktop_list' | awk '{print $4}' )
# but then show the
but I would need a complete list of desktops to populate the $desktop_list matches...
Bookmarks