You are Here:
Download Linux Lite 5.8 RC1 today - See Release Announcements



X Close Ad
X Close Ad
Create System Report GUI

Author (Read 10930 times)

0 Members and 1 Guest are viewing this topic.

Create System Report GUI
« on: November 30, 2014, 02:01:15 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 688
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
This is what I've done so far.
Added: A question to start the process
            Progress bar to display messages as the report continues
            A question to display the results
Problem is next:
            $HOME environment variable prints out /root when the script is run with 'gksudo'
If we have a script
Code: [Select]
#!/bin/bash
# This script is /usr/scripts/some_script
echo $HOME
and run it with gksudo we'll get
Code: [Select]
$ gksudo /usr/scripts/some_script
/root

So it's saving the report in the '/root' directory

Solution:
              Running the script with 'gksudo -k /usr/scripts/systeminfo'
From man gksu
 --preserve-env, -k

              Preserve the current environments, does not set $HOME nor $PATH,
              for example.


Here is the full script:
Code: [Select]
#!/bin/bash
# Linux Lite System Information Report Tool for Ubuntu based systems
# Dependencies - lshw, dmidecode, hdparm
# Developer - Jerry Bezencon
# Creation Date - Monday 29th April, 2013
# Website - http://www.linuxliteos.com
# Credits - Various people at the Linux Distro Community including but not limited to:
# Armageddon, pdq, pingcasts, preecher, setkeh, Shaggytwodope, Stripe, zoose


DATE=$(date +"%A-%d-%B-%Y-%T")
rm -rf $HOME/systeminfo*

# Script start
if zenity --title="Question" --question text="Click Yes to proceed, No to cancel";  then

# Create file and insert date
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Report Date: "$(date +"%r, %d - %m - %Y") >> $HOME/systeminfo-"${DATE}".txt
now=$(date +"%r, %d - %m - %Y") >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/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 "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Bios & Motherboard Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo " BIOS:" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
sudo dmidecode -t 0 >> $HOME/systeminfo-"${DATE}".txt

echo " MOTHERBOARD:" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
sudo dmidecode -t 2 >> $HOME/systeminfo-"${DATE}".txt
sudo dmidecode -t 3 >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "10"
echo "#CPU Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "CPU Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
grep "model name" /proc/cpuinfo >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
lscpu >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "17"
echo "#Collecting Memory Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Memory Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo " RAM SPEED:" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
sudo dmidecode --type 17 | grep -i speed >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo " PHYSICAL RAM DETAILS (one section per ram slot):" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
sudo dmidecode --type 17 >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "25"
echo "#Collecting Graphics Chip Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Graphics Chip Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
sudo lshw -C display >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "40"
echo "#Collecting Sound Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Sound Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
aplay --list-devices >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "45"
echo "#Collecting Hard Drive/SSD Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Hard Drive/SSD Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
df -T >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo " MOUNT:" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
mount >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo " FDISK:" >> $HOME/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sda >> $HOME/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sdb >> $HOME/systeminfo-"${DATE}".txt
sudo fdisk -l /dev/sdc >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo " HDPARM:" >> $HOME/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sda >> $HOME/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sdb >> $HOME/systeminfo-"${DATE}".txt
sudo hdparm -i /dev/sdc >> $HOME/systeminfo-"${DATE}".txt

echo "50"
echo "#Collecting Groups Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Groups Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
groups $USER >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "55"
echo "#Collecting PCI Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "PCI Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
lspci >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "60"
echo "#Collecting USB Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "USB Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
lsusb >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "65"
echo "#Collecting Kernel Modules Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Kernel Modules Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
lsmod >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "70"
echo "#Collecting Kernel & OS Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Kernel & Operating System Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
uname -a >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
lsb_release -d >> $HOME/systeminfo-"${DATE}".txt
lsb_release -i >> $HOME/systeminfo-"${DATE}".txt
lsb_release -c >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
echo "Based on:" >> $HOME/systeminfo-"${DATE}".txt
cat /etc/issue.net >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "75"
echo "#Collecting Network Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Network Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
ifconfig >> $HOME/systeminfo-"${DATE}".txt
more /etc/network/interfaces >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
sudo lshw -C network >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "80"
echo "#Collecting Environment Variables"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Environment Variables Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
printenv >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "85"
echo "#Collecting Software Information"
sleep 1

echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "Software Installed Information" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt
dpkg --list >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt


echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "End of Report" >> $HOME/systeminfo-"${DATE}".txt
echo "===========================================================" >> $HOME/systeminfo-"${DATE}".txt
echo "" >> $HOME/systeminfo-"${DATE}".txt

echo "#Done"
echo "100"

) | zenity --progress --auto-close --title="system report" --no-cancel

else
   exit
fi

# Prompt user to open report
if zenity --title="Question" --question text="Would you like to open the report now?" ; then
xdg-open $HOME/systeminfo-"${DATE}".txt
else
   exit 1
fi
exit
« Last Edit: November 30, 2014, 06:25:33 PM by misko_2083 »
 

Re: Create System Report GUI
« Reply #1 on: November 30, 2014, 02:23:52 PM »
 

Mike

  • Forum Regular
  • ***
  • 212
    Posts
  • Reputation: 26
  • Linux Lite Enthusiast

  • Linux Lite: 3.6 64bit
Thanks misko. Have you considered using YAD for the gui?
 

Re: Create System Report GUI
« Reply #2 on: November 30, 2014, 02:40:03 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 688
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Yo're welcome :)
I personally like YAD, but there is no way of telling when the development of YAD will end.
If that happens, and we have GUI tools that depend on it, then we would have a big problem.
Zenity is more likely to stay, so we are staying with it.
Cheers :)
 

Re: Create System Report GUI
« Reply #3 on: November 30, 2014, 03:40:27 PM »
 

Mike

  • Forum Regular
  • ***
  • 212
    Posts
  • Reputation: 26
  • Linux Lite Enthusiast

  • Linux Lite: 3.6 64bit
Good to know! Thanks. Will you be putting these in some kind of VCS so that we can submit patches? :)
 

Re: Create System Report GUI
« Reply #4 on: November 30, 2014, 03:58:02 PM »
 

Mike

  • Forum Regular
  • ***
  • 212
    Posts
  • Reputation: 26
  • Linux Lite Enthusiast

  • Linux Lite: 3.6 64bit
Also some notes about the script:

* It would be nice if it saved the text file in the same location as the script itself
* Unfortunately, it didn't open a dialog at the end to ask me if I wanted to open the report
* Typo in the dialog title: says "sytem" instead of "system"
* It did not produce BIOS and Motherboard info for me
* For some reason the columns aren't showing correctly in the Software Installed Information section of the text file. It looks fine when I run dpkg --list in the terminal though.
 

Re: Create System Report GUI
« Reply #5 on: November 30, 2014, 06:24:45 PM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 688
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
Also some notes about the script:

* It would be nice if it saved the text file in the same location as the script itself
* Unfortunately, it didn't open a dialog at the end to ask me if I wanted to open the report
* Typo in the dialog title: says "sytem" instead of "system"
* It did not produce BIOS and Motherboard info for me
* For some reason the columns aren't showing correctly in the Software Installed Information section of the text file. It looks fine when I run dpkg --list in the terminal though.
* It would be nice if it saved the text file in the same location as the script itself
The script is ment to be the part of OS in /usr/scripts
You don't want to have your report in that location. :)
* Unfortunately, it didn't open a dialog at the end to ask me if I wanted to open the report
Strange, xdg-open should open it in a text editor.
* Typo in the dialog title: says "sytem" instead of "system"
Thank you. Fixed.
* It did not produce BIOS and Motherboard info for me
Did you start the script in a terminal?
gksudo -k /path/to/the/script
* For some reason the columns aren't showing correctly in the Software Installed Information section of the text file. It looks fine when I run dpkg --list in the terminal though.
That's how the script works. The same thing is with the current one. Find it in the Whisker menu. It's named 'Create System Report'.
 

Re: Create System Report GUI
« Reply #6 on: November 30, 2014, 06:52:41 PM »
 

Mike

  • Forum Regular
  • ***
  • 212
    Posts
  • Reputation: 26
  • Linux Lite Enthusiast

  • Linux Lite: 3.6 64bit
Ah, ok - that makes sense. Some of those issues could be related to me not running them as superuser.
 

Re: Create System Report GUI
« Reply #7 on: November 30, 2014, 07:51:58 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8203
    Posts
  • Reputation: 764
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.6 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
This is awesome! Any chance we can get the text file to pop up in a zenity text info box at the end?
 

Re: Create System Report GUI
« Reply #8 on: November 30, 2014, 08:35:09 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8203
    Posts
  • Reputation: 764
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.6 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Some cosmetic changes, code changes, report now save to /tmp etc...

Code: [Select]
#!/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.linuxliteos.com

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";  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

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" ; then
xdg-open /tmp/systeminfo-"${DATE}".txt
else
   exit 1
fi
exit
 

Re: Create System Report GUI
« Reply #9 on: November 30, 2014, 08:45:40 PM »
 

Mike

  • Forum Regular
  • ***
  • 212
    Posts
  • Reputation: 26
  • Linux Lite Enthusiast

  • Linux Lite: 3.6 64bit
Nice! I like that, Jerry. Should these changes be tracked in Github or is this sort of the testing place before putting it there?
 

Re: Create System Report GUI
« Reply #10 on: November 30, 2014, 08:51:34 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8203
    Posts
  • Reputation: 764
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.6 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Nice! I like that, Jerry. Should these changes be tracked in Github or is this sort of the testing place before putting it there?

The changes will go on github once the code is ready to go into the lite-software package. For now we'll just throw around ideas in this thread until the code reaches a finished state.
 

Re: Create System Report GUI
« Reply #11 on: November 30, 2014, 09:03:04 PM »
 

Mike

  • Forum Regular
  • ***
  • 212
    Posts
  • Reputation: 26
  • Linux Lite Enthusiast

  • Linux Lite: 3.6 64bit
Sounds good to me. I kind of like this forum method anyway. :)
 

Re: Create System Report GUI
« Reply #12 on: November 30, 2014, 09:05:08 PM »
 

Jerry

  • Linux Lite Creator
  • Administrator
  • Platinum Level Poster
  • *****
  • 8203
    Posts
  • Reputation: 764
  • Linux Lite Member
    • Linux Lite OS

  • Linux Lite: 5.6 64bit

  • CPU: Intel Core i9-10850K CPU @ 3.60GHz

  • MEMORY: 32Gb

  • VIDEO CARD: nVidia GeForce GTX 1650

  • Kernel: 5.x
Yeah, it exposes the code to more people so they can easily make suggestions.
 

Re: Create System Report GUI
« Reply #13 on: December 01, 2014, 07:29:58 AM »
 

sysdrum

  • Saying the wrong things at the right time.
  • Occasional Poster
  • **
  • 83
    Posts
  • Reputation: 12
  • That's personal.

  • Linux Lite: 3.8 64bit

  • CPU: Intel Core i5-6400

  • MEMORY: 16Gb

  • VIDEO CARD: Nvidia 1050 Ti
I like that you are using xdg-open to remove dependency issues on a text editors so what ever your default is that it opens but is it possible to avoid an editor all together?

 

Re: Create System Report GUI
« Reply #14 on: December 01, 2014, 10:55:16 AM »
 

misko_2083

  • Gold Level Poster
  • *******
  • 688
    Posts
  • Reputation: 191
  • Linux Lite Member

  • CPU: Dual core Pentium E5700 3GHz

  • MEMORY: 3Gb

  • VIDEO CARD: GeForce GT 430
My idea is to find the users that can log in and then, to use the list to choose the save location.
Finally copy the file to the save location.
Something like this:

Code: [Select]
#!/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.linuxliteos.com

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";  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

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" ; then
    zenity --text-info --width=800 --height=700 --ok-label="Save" --cancel-label="Close" < /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
            LL_USER=(`awk -F':' '$3>=1000 && $3<=60000 {print "/home/"$1"/Desktop"}' /etc/passwd`)
           
            save_location=$(zenity --list --text="Select the save location" --column="1" "${LL_USER[@]}")
                if [ $? -ne 0 ]; then
                    exit
                else
                        cp /tmp/systeminfo-"${DATE}".txt $save_location
                        # chown
                fi
           
        fi

else
   exit
fi

exit
 

 

X Close Ad
X Close Ad

Download Linux Lite 5.8 RC1 today - See Release Announcements