Porteus Diag Tool

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Porteus Diag Tool

Post#1 by Hamza » 23 Apr 2011, 14:29

This is a tool for report your current configuration on the forum.

All credits go to brokenman!

Code: Select all

#!/bin/bash

ver=`cat /etc/porteus-version`
user=$(whoami)
osdrive=$(ls /mnt/live/mnt)
kernel=$(uname -r)
machine=$(uname -m)
mounted=$(df -Th | grep dev)
processor=$(uname -p)
cfg=$(cat /proc/cmdline)
ram=$(fgrep Mem /proc/meminfo)
sound=$(cat /proc/asound/cards)
network=$(ifconfig)
ns=$(cat /etc/resolv.conf)
usb=$(lsusb)
pci=$(lspci)
modules=$(ls -1 /mnt/live/memory/images)
dmes=$(dmesg | tail )
logs=$(cat /var/log/messages | tail)
soundriver=$(cat /proc/asound/version)
screen=$(xrandr | grep Screen)


get_config() {
echo '=== Version of Porteus ==' >> $config
echo $ver >> $config
echo '=== Current User ===' >> $config
echo $user >> $config
echo '=== Screen info ===' >> $config
echo $screen >> $config
echo '=== Boot Device ===' >> $config
echo $osdrive >> $config
echo '=== Kernel Info ===' >> $config
echo $kernel >> $config
echo '=== Machine Info ===' >> $config
echo $machine >> $config
echo '=== Devices Mounted ===' >> $config
echo $mounted >> $config
echo '=== CPU Info ===' >> $config
echo $processor >> $config
echo '=== Boot Config ===' >> $config
echo $cfg >> $config
echo '=== RAM Info ===' >> $config
echo $ram >> $config
echo '=== Sound Info ===' >> $config
echo $sound >> $config
echo '   ' >> $config
echo 'Sound Driver' >> $config
echo $sounddriver >> $config
echo '=== Network Info ===' >> $config
echo $network >> $config
echo '=== DNS Local ===' >> $config
echo $ns >> $config >> $config
echo '=== USB Devices ===' >> $config
echo $usb >> $config >> $config
echo '=== PCI Devices ===' >> $config
echo $pci >> $config
echo '=== Modules Info ===' >> $config
echo $modules >> $config
echo '==== SysLog ====' >> $config
echo 'DMesg file :' >> $config
echo '   ' >> $config
echo $dmes >> $config
echo '   ' >> $config
echo 'Messages file' >> $config
echo $logs >> $config
}

if [ "$1" = "-info" ]; then
echo " "
echo "USAGE : Run $0 without any arguments"
echo "Written for Porteus OS"
echo " "
echo "Porteus Diag Tool"
echo "Version 0.1alpha"
echo "All credits go to Brokenman" 
exit
else
echo " "
echo "USAGE : Run $0 without any arguments"
echo "Written for Porteus OS"
echo " "
exit
fi

if [ "$1" = "-version" ]; then
echo " "
echo "Porteus Diag Tool"
echo "Version 0.1alpha"
echo "Written for The Porteus Community"
echo "All credits is for Brokenman" 
exit
fi

echo "Where do you want to save the output of this script?"
echo "You must type the full path."
read config

if [ -d $config ]; then 
clear
echo "I cannot save your config file in $config"
echo "Exiting..."
else
echo "Good ,You have selected an empty for save your config file."
get_config
fi
Any suggestions are welcome!
NjVFQzY2Rg==

User avatar
Quax
Full of knowledge
Full of knowledge
Posts: 21
Joined: 29 Dec 2010, 21:28
Distribution: FluxFlux (ARM + x86), Slax7
Location: Muelheim an der Ruhr, Germany
Contact:

Re: Porteus Diag Tool

Post#2 by Quax » 23 Apr 2011, 18:46

board=$(dmidecode | grep -A2 "Base Board")

Quax
Erfahrung bedeutet gar nichts - man kann Dinge auch 15 Jahre lang falsch machen...

Experience means nothing - one could have done things wrong for the last 15 years...

User avatar
82issa
DOC Team
DOC Team
Posts: 127
Joined: 13 Apr 2011, 17:24
Location: USA, NC

Re: Porteus Diag Tool

Post#3 by 82issa » 23 Apr 2011, 18:47

Need to add md5sums on xzm's so they can be identified corrupt or out dated.
Sorry guys... I got to go. My girlfriend just casted "get your dirty ass into the shower" on me.
Oh and here is some naked grandpa pictures too.

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Porteus Diag Tool

Post#4 by Hamza » 23 Apr 2011, 18:57

board=$(dmidecode | grep -A2 "Base Board")
You can post your version.

Thanks for suggestion !

Posted after 1 minute 36 seconds:
Need to add md5sums on xzm's so they can be identified corrupt or out dated.
Can't add it.
NjVFQzY2Rg==

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Porteus Diag Tool

Post#5 by fanthom » 24 Apr 2011, 22:52

@82issa
"Need to add md5sums on xzm's so they can be identified corrupt or out dated."
have a look on /usr/bin/chkbase.sh script
Please add [Solved] to your thread title if the solution was found.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Porteus Diag Tool

Post#6 by brokenman » 02 May 2011, 13:44

psinfo (Porteus system info) is already included in Porteus. Hamza if you can use the psinfo script to make something better please do so. Keep it as CLI though and the result should be a text file on the users desktop.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Hamza
Warlord
Warlord
Posts: 1908
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Porteus Diag Tool

Post#7 by Hamza » 02 May 2011, 14:12

I can include the Dialog Box , but must know what are the only desktops included in Porteus.

Will add a function for looks if it's KDE/LXDE Desktop.

Thanks Brokenman!
NjVFQzY2Rg==

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Porteus Diag Tool

Post#8 by brokenman » 02 May 2011, 23:01

I can include the Dialog Box
Probably better if it doesn't have a dialog box. One reason someone might be using the script is because of a problem getting into an X session, or botting porteus. In this case they won't have the opportunity to see a dialog box. This is why i left psinfo as CLI.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Post Reply