Posts: 83
Threads: 8
Joined: Mar 2014
Reputation:
0
I added the UI adjustments:
Code: #!/bin/bash
# Linux Lite System Information Report Tool for Ubuntu based systems
# Dependencies - lshw, dmidecode, hdparm
# Developer - Misko_2083, Jerry Bezencon
# Creation Date - 30th November, 2013
# Website - http://www.freecinema2022.gq
DATE=$(date +"%A-%d-%B-%Y-%T")
rm -rf /tmp/systeminfo*
# Script start
if zenity --question --title="Create System Report" --text="Click Yes to proceed or No to cancel" --width=400; then
# Create file and insert date
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Report Date: "$(date +"%r, %d - %m - %Y") >> /tmp/systeminfo-"${DATE}".txt
now=$(date +"%r, %d - %m - %Y") >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
# Begin reporting information
(
echo "1"
echo "#This Report may take a while to generate..."
sleep 2
echo "5"
echo "#Collecting Bios & Motherboard Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Bios & Motherboard Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " BIOS:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode -t 0 >> /tmp/systeminfo-"${DATE}".txt
echo " MOTHERBOARD:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode -t 2 >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode -t 3 >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "10"
echo "#CPU Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "CPU Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
grep "model name" /proc/cpuinfo >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lscpu >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "17"
echo "#Collecting Memory Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Memory Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " RAM SPEED:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode --type 17 | grep -i speed >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " PHYSICAL RAM DETAILS (one section per ram slot):" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode --type 17 >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "25"
echo "#Collecting Graphics Chip Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Graphics Chip Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo lshw -C display >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "40"
echo "#Collecting Sound Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Sound Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
aplay --list-devices >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "45"
echo "#Collecting Hard Drive/SSD Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Hard Drive/SSD Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
df -T >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " MOUNT:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
mount >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " FDISK:" >> /tmp/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sda >> /tmp/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sdb >> /tmp/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sdc >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " HDPARM:" >> /tmp/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sda >> /tmp/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sdb >> /tmp/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sdc >> /tmp/systeminfo-"${DATE}".txt
echo "50"
echo "#Collecting Groups Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Groups Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
groups $USER >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "55"
echo "#Collecting PCI Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "PCI Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lspci >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "60"
echo "#Collecting USB Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "USB Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lsusb >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "65"
echo "#Collecting Kernel Modules Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Kernel Modules Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lsmod >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "70"
echo "#Collecting Kernel & OS Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Kernel & Operating System Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
uname -a >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lsb_release -d >> /tmp/systeminfo-"${DATE}".txt
lsb_release -i >> /tmp/systeminfo-"${DATE}".txt
lsb_release -c >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "Based on:" >> /tmp/systeminfo-"${DATE}".txt
cat /etc/issue.net >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "75"
echo "#Collecting Network Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Network Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
ifconfig >> /tmp/systeminfo-"${DATE}".txt
more /etc/network/interfaces >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo lshw -C network >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "80"
echo "#Collecting Environment Variables..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Environment Variables Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
printenv >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "85"
echo "#Collecting Software Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Software Installed Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
dpkg --list >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "End of Report" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "#Done"
echo "100"
) | zenity --progress --auto-close --title="Collecting System Information..." --no-cancel --width=400
else
exit
fi
# Prompt user to open report
if zenity --question --title="Create System Report" --text="Click View Report or Quit" --ok-label="View Report" --cancel-label="Quit" --width=400; then
zenity --text-info --width=800 --height=700 --ok-label="Save" --cancel-label="Quit" < /tmp/systeminfo-"${DATE}".txt
if [ $? -ne 0 ]; then
exit
else
#get normal users
# User id MIN and MAX: grep "^UID_MIN" /etc/login.defs; grep "^UID_MAX" /etc/login.defs
# Print users and groups: awk -F':' '$3>=1000 && $3<=60000 {print $1" "$3}' /etc/passwd
#Generate the save list and on the first occurance of "FALSE" change it to "TRUE"
LL_LIST_D=(`awk -F':' '$3>=1000 && $3<=60000 {print "FALSE","/home/"$1}' /etc/passwd |sed '0,/FALSE/s/FALSE/TRUE/'`)
#Add optional save location
LL_LIST_H=(`awk -F':' '$3>=1000 && $3<=60000 {print "FALSE","/home/"$1"/Desktop"}' /etc/passwd`)
save_location=$(zenity --list --radiolist --text="Select the save location" --column="1" --column="2" "${LL_LIST_D[@]}" "${LL_LIST_H[@]}")
if [ $? -ne 0 ]; then
exit
else
#Extract username
LL_USER=$(echo "$save_location" | cut -d'/' -f3)
# Add filename to the save path
SAVE_PATH=$(echo $save_location| sed 's,.*,&\/systeminfo-'"${DATE}"'.txt,g')
# copy the file from /tmp
cp /tmp/systeminfo-"${DATE}".txt $save_location
#Change owner of the file to LL_USER
sudo chown $LL_USER $SAVE_PATH
fi
fi
else
exit
fi
exit
Posts: 8,895
Threads: 541
Joined: Feb 2014
Reputation:
5
Wow!! I'm very impressed, the next update for Create System Report will be a thing of beauty. Thank you misko and sysdrum
Posts: 212
Threads: 14
Joined: Nov 2014
Reputation:
0
This looks great, guys! My only suggestion is to remove the "1" and "2" headers. If you leave them blank it looks better IMO. Or just make column 2 say "Path".
Posts: 83
Threads: 8
Joined: Mar 2014
Reputation:
0
12-02-2014, 02:43 PM
(This post was last modified: 12-03-2014, 02:47 AM by sysdrum.)
Updated with "Select" "Save file location:" as replacement for 1 and 2 in the column header name space. Adjusted titles and other UI updates.
Cleaned up alignments and title placements, along with adjustments to sizing of zenity dialog windows under a uniform width. Adjusted labels to clearly define the selection.
Code: #!/bin/bash
# Linux Lite System Information Report Tool for Ubuntu based systems.
# Dependencies - lshw, dmidecode, hdparm
# Developer - Misko_2083, Jerry Bezencon, Sysdrum
# Creation Date - 30th November, 2013 Revision Date - 2nd December 2014
# Website - http://www.freecinema2022.gq
DATE=$(date +"%A-%d-%B-%Y-%T")
rm -rf /tmp/systeminfo*
# Script start
if zenity --question --title="Create System Report" --text="System Report needs to collect information. Click Create Report to proceed or Cancel to exit System Report." --ok-label="Create Report" --cancel-label="Cancel" --width=400; then
# Create file and insert date
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Report Date: "$(date +"%r, %d - %m - %Y") >> /tmp/systeminfo-"${DATE}".txt
now=$(date +"%r, %d - %m - %Y") >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
# Begin reporting information
(
echo "1"
echo "#This Report may take a while to generate..."
sleep 2
echo "5"
echo "#Collecting Bios & Motherboard Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Bios & Motherboard Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " BIOS:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode -t 0 >> /tmp/systeminfo-"${DATE}".txt
echo " MOTHERBOARD:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode -t 2 >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode -t 3 >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "10"
echo "#CPU Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "CPU Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
grep "model name" /proc/cpuinfo >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lscpu >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "17"
echo "#Collecting Memory Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Memory Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " RAM SPEED:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode --type 17 | grep -i speed >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " PHYSICAL RAM DETAILS (one section per ram slot):" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode --type 17 >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "25"
echo "#Collecting Graphics Chip Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Graphics Chip Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo lshw -C display >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "40"
echo "#Collecting Sound Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Sound Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
aplay --list-devices >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "45"
echo "#Collecting Hard Drive/SSD Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Hard Drive/SSD Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
df -T >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " MOUNT:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
mount >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " FDISK:" >> /tmp/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sda >> /tmp/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sdb >> /tmp/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sdc >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " HDPARM:" >> /tmp/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sda >> /tmp/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sdb >> /tmp/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sdc >> /tmp/systeminfo-"${DATE}".txt
echo "50"
echo "#Collecting Groups Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Groups Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
groups $USER >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "55"
echo "#Collecting PCI Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "PCI Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lspci >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "60"
echo "#Collecting USB Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "USB Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lsusb >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "65"
echo "#Collecting Kernel Modules Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Kernel Modules Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lsmod >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "70"
echo "#Collecting Kernel & OS Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Kernel & Operating System Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
uname -a >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lsb_release -d >> /tmp/systeminfo-"${DATE}".txt
lsb_release -i >> /tmp/systeminfo-"${DATE}".txt
lsb_release -c >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "Based on:" >> /tmp/systeminfo-"${DATE}".txt
cat /etc/issue.net >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "75"
echo "#Collecting Network Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Network Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
ifconfig >> /tmp/systeminfo-"${DATE}".txt
more /etc/network/interfaces >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo lshw -C network >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "80"
echo "#Collecting Environment Variables..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Environment Variables Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
printenv >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "85"
echo "#Collecting Software Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Software Installed Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
dpkg --list >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "End of Report" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "#Done"
echo "100"
) | zenity --progress --auto-close --title="Collecting System Information" --no-cancel --width=325
else
exit
fi
# Prompt user to open report
if zenity --question --title="View System Report" --text="System Report has collected required system data. Click View Report to see the report or Cancel to exit System Report." --ok-label="View Report" --cancel-label="Cancel" --width=400; then
zenity --title="System Report" --text-info --width=800 --height=700 --ok-label="Save" --cancel-label="Quit" < /tmp/systeminfo-"${DATE}".txt
if [ $? -ne 0 ]; then
exit
else
#get normal users
# User id MIN and MAX: grep "^UID_MIN" /etc/login.defs; grep "^UID_MAX" /etc/login.defs
# Print users and groups: awk -F':' '$3>=1000 && $3<=60000 {print $1" "$3}' /etc/passwd
#Generate the save list and on the first occurance of "FALSE" change it to "TRUE"
LL_LIST_D=(`awk -F':' '$3>=1000 && $3<=60000 {print "FALSE","/home/"$1}' /etc/passwd |sed '0,/FALSE/s/FALSE/TRUE/'`)
#Add optional save location
LL_LIST_H=(`awk -F':' '$3>=1000 && $3<=60000 {print "FALSE","/home/"$1"/Desktop"}' /etc/passwd`)
save_location=$(zenity --title="System Report Save Location" --list --radiolist --text="Select save location:" --column="Select" --column="Save file location:" --width=325 "${LL_LIST_D[@]}" "${LL_LIST_H[@]}")
if [ $? -ne 0 ]; then
exit
else
#Extract username
LL_USER=$(echo "$save_location" | cut -d'/' -f3)
# Add filename to the save path
SAVE_PATH=$(echo $save_location| sed 's,.*,&\/systeminfo-'"${DATE}"'.txt,g')
# copy the file from /tmp
cp /tmp/systeminfo-"${DATE}".txt $save_location
#Change owner of the file to LL_USER
sudo chown $LL_USER $SAVE_PATH
fi
fi
else
exit
fi
exit
Posts: 688
Threads: 49
Joined: Jul 2014
sysdrum, thanks for the UI adjustments, but bash arrays are missing in the zenity list dialog. "${LL_LIST_D[@]}"
Posts: 212
Threads: 14
Joined: Nov 2014
Reputation:
0
Just out of curiosity, what's the benefit of using this script vs. HardInfo?
Posts: 688
Threads: 49
Joined: Jul 2014
(12-02-2014, 11:36 PM)mlsmith link Wrote: Just out of curiosity, what's the benefit of using this script vs. HardInfo? HardInfo is a good tool for users.
Create System Report is uset to create a .txt file that can be attached to the forum.
Posts: 212
Threads: 14
Joined: Nov 2014
Reputation:
0
HardInfo creates a txt file too but I do like the output of this script better. I think the simplicity and small file size is another benefit of this script.
Posts: 83
Threads: 8
Joined: Mar 2014
Reputation:
0
(12-02-2014, 04:21 PM)misko_2083 link Wrote: sysdrum, thanks for the UI adjustments, but bash arrays are missing in the zenity list dialog. "${LL_LIST_D[@]}"
I am not sure why it wasn't it was in the file when I copied and posted the code.
Posts: 8,895
Threads: 541
Joined: Feb 2014
Reputation:
5
Latest code, some rewording, cosmetic changes:
Code: #!/bin/bash
# Linux Lite System Information Report Tool for Ubuntu based systems.
# Dependencies - lshw, dmidecode, hdparm
# Developer - Misko_2083, Jerry Bezencon, Sysdrum
# Creation Date - 30th November, 2013 Revision Date - 6th December 2014
# Website - http://www.freecinema2022.gq
DATE=$(date +"%A-%d-%B-%Y-%T")
rm -rf /tmp/systeminfo*
# Script start
if zenity --question --title="Create System Report" --text="System Report needs to collect information.\n\nClick Create Report to proceed or Cancel to exit." --ok-label="Create Report" --cancel-label="Cancel" --width=400; then
# Create file and insert date
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Report Date: "$(date +"%r, %d - %m - %Y") >> /tmp/systeminfo-"${DATE}".txt
now=$(date +"%r, %d - %m - %Y") >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
# Begin reporting information
(
echo "1"
echo "#This Report may take a while to generate..."
sleep 2
echo "5"
echo "#Collecting Bios & Motherboard Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Bios & Motherboard Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " BIOS:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode -t 0 >> /tmp/systeminfo-"${DATE}".txt
echo " MOTHERBOARD:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode -t 2 >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode -t 3 >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "10"
echo "#Collecting CPU Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "CPU Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
grep "model name" /proc/cpuinfo >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lscpu >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "17"
echo "#Collecting Memory Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Memory Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " RAM SPEED:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode --type 17 | grep -i speed >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " PHYSICAL RAM DETAILS (one section per ram slot):" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo dmidecode --type 17 >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "25"
echo "#Collecting Graphics Chip Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Graphics Chip Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo lshw -C display >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "40"
echo "#Collecting Sound Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Sound Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
aplay --list-devices >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "45"
echo "#Collecting Hard Drive/SSD Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Hard Drive/SSD Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
df -T >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " MOUNT:" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
mount >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " FDISK:" >> /tmp/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sda >> /tmp/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sdb >> /tmp/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sdc >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo " HDPARM:" >> /tmp/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sda >> /tmp/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sdb >> /tmp/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sdc >> /tmp/systeminfo-"${DATE}".txt
echo "50"
echo "#Collecting Groups Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Groups Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
groups $USER >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "55"
echo "#Collecting PCI Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "PCI Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lspci >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "60"
echo "#Collecting USB Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "USB Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lsusb >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "65"
echo "#Collecting Kernel Modules Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Kernel Modules Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lsmod >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "70"
echo "#Collecting Kernel & OS Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Kernel & Operating System Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
uname -a >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
lsb_release -d >> /tmp/systeminfo-"${DATE}".txt
lsb_release -i >> /tmp/systeminfo-"${DATE}".txt
lsb_release -c >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "Based on:" >> /tmp/systeminfo-"${DATE}".txt
cat /etc/issue.net >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "75"
echo "#Collecting Network Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Network Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
ifconfig >> /tmp/systeminfo-"${DATE}".txt
more /etc/network/interfaces >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
sudo lshw -C network >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "80"
echo "#Collecting Environment Variables..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Environment Variables Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
printenv >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "85"
echo "#Collecting Software Information..."
sleep 1
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "Software Installed Information" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
dpkg --list >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "End of Report" >> /tmp/systeminfo-"${DATE}".txt
echo "===========================================================" >> /tmp/systeminfo-"${DATE}".txt
echo "" >> /tmp/systeminfo-"${DATE}".txt
echo "#Done"
echo "100"
) | zenity --progress --auto-close --title="Collecting System Information" --no-cancel --width=325
else
exit
fi
# Prompt user to open report
if zenity --question --title="View System Report" --text="Create System Report has collected the required system data.\n\nClick View Report to see the report or Cancel to exit." --ok-label="View Report" --cancel-label="Cancel" --width=400; then
zenity --title="System Report" --text-info --width=800 --height=700 --ok-label="Save" --cancel-label="Quit" < /tmp/systeminfo-"${DATE}".txt
if [ $? -ne 0 ]; then
exit
else
#get normal users
# User id MIN and MAX: grep "^UID_MIN" /etc/login.defs; grep "^UID_MAX" /etc/login.defs
# Print users and groups: awk -F':' '$3>=1000 && $3<=60000 {print $1" "$3}' /etc/passwd
#Generate the save list and on the first occurance of "FALSE" change it to "TRUE"
LL_LIST_D=(`awk -F':' '$3>=1000 && $3<=60000 {print "FALSE","/home/"$1}' /etc/passwd |sed '0,/FALSE/s/FALSE/TRUE/'`)
#Add optional save location
LL_LIST_H=(`awk -F':' '$3>=1000 && $3<=60000 {print "FALSE","/home/"$1"/Desktop"}' /etc/passwd`)
save_location=$(zenity --title="Create System Report: Save Location" --list --radiolist --text="Select save location then click on <b>Ok:</b>" --column="Select" --column="Save file location" --width=350 --height 200 "${LL_LIST_D[@]}" "${LL_LIST_H[@]}")
if [ $? -ne 0 ]; then
exit
else
#Extract username
LL_USER=$(echo "$save_location" | cut -d'/' -f3)
# Add filename to the save path
SAVE_PATH=$(echo $save_location| sed 's,.*,&\/systeminfo-'"${DATE}"'.txt,g')
# copy the file from /tmp
cp /tmp/systeminfo-"${DATE}".txt $save_location
#Change owner of the file to LL_USER
sudo chown $LL_USER $SAVE_PATH
fi
fi
else
exit
fi
exit
Would like to see added the removal of any previous system reports in ~/ and ~/Desktop at the start of the script.
|