Commit 9817f1df authored by Kyle Robertze's avatar Kyle Robertze
Browse files

added aims-collect-support-data script

parent 2a0efd50
[Desktop Entry]
Encoding=UTF-8
Name=AIMS Collect Support Data
Comment=Posts system information to a public pastebin
Exec=aims-collect-support-data gui
Icon=aims-starburst
Terminal=false
Type=Application
#!/bin/bash
mkdir -p ~/.aims
LOGFILE=~/.aims/$HOSTNAME
WELCOME="This script will post system information on a public pastebin for support purposes. You will have a chance to review the data before the information is posted. Afterwards, you will receive a link that you can submit to your support department containing the support data."
if [ "$1" = "gui" ]; then
zenity --title "AIMS Desktop Support" --info --text "$WELCOME" --icon-name="aims-starburst" --width=480
fi
if [ "$1" = "menu" ]; then
whiptail --title "AIMS Desktop Support" --msgbox \
"$WELCOME Use the arrow buttons to navigate and ENTER to select." 12 70
fi
echo " * Writing data to $LOGFILE..."
(
echo -e "== Basic System Information ==\n"
echo " * System Time: $(date)"
echo " * Hostname: $HOSTNAME"
echo " * Username: $USER"
echo " * Kernel Version: $(uname -r)"
) > $LOGFILE
echo -e "\n== Memory Information ==\n" >> $LOGFILE
free -h >> $LOGFILE
echo -e "\n== Top Memory Using Processes ==\n" >> $LOGFILE
echo '%Mem Process' >> $LOGFILE
ps ax -o %mem -o comm | tail -n+2 | sort -nr | head >> $LOGFILE
echo -e "\n== Disk Space Usage==\n" >> $LOGFILE
df -h >> $LOGFILE
echo -e "\n== PCI Devices ==\n" >> $LOGFILE
lspci >> $LOGFILE
echo -e "\n== Attached USB Devices ==\n" >> $LOGFILE
lsusb >> $LOGFILE
echo -e "\n== Network Configuration ==\n" >> $LOGFILE
echo "Routing:" >> $LOGFILE
/sbin/route >> $LOGFILE
echo -e "\nInterfaces:" >> $LOGFILE
/sbin/ifconfig >> $LOGFILE
echo -e "\n== APT Status ==\n" >> $LOGFILE
echo -e "Contents of /etc/apt/sources.list.d/:" >> $LOGFILE
ls -1 /etc/apt/sources.list.d >> $LOGFILE
echo -e "\n== CPU Information ==\n" >> $LOGFILE
cat /proc/cpuinfo >> $LOGFILE
if [ "$1" = "menu" ]; then
whiptail --scrolltext --title "AIMS Desktop Support" --textbox $LOGFILE 23 78
whiptail --title "AIMS Desktop Support" --yesno " Submit data to pastebin?" 7 38
if [ "$?" = "1" ]; then
ACTION="abort"
fi
fi
if [ "$1" = "gui" ]; then
zenity --title "AIMS Desktop Support" --text-info --filename=$LOGFILE --ok-label="Submit to Pastebin" --width=480 --height=600
if [ "$?" = "1" ]; then
ACTION="abort"
fi
fi
if [ "$ACTION" = "abort" ]; then
ABORT_TEXT="Support request aborted."
if [ "$1" = "menu" ]; then
whiptail --title "AIMS Desktop Support" --msgbox "$ABORT_TEXT." 10 48
fi
if [ "$1" = "gui" ]; then
zenity --title "AIMS Desktop Support" --info --text "$ABORT_TEXT" --icon-name="aims-starburst"
fi
exit 1
fi
echo " * Sending information to pastebin..."
pastebinurl=$(pastebinit $LOGFILE)
INFOTEXT="Information has been posted to $pastebinurl. Share that URL with your IT centre for further assistance."
if [ "$1" = "menu" ]; then
whiptail --title "AIMS Desktop Support" --msgbox "$INFOTEXT" 10 48
fi
if [ "$1" = "gui" ]; then
zenity --title "AIMS Desktop Support" --info --text "Information has been posted to $pastebinurl. Share that URL with your IT centre for further assistance." --icon-name="aims-starburst" --width=480
fi
echo " * Pastebin URL is $pastebinurl"
aims-desktop (2016.12.04) unstable; urgency=medium
* Add aims-collect-support-data script and icon
-- Kyle Robbertze <krobbertze@gmail.com> Wed, 14 Dec 2016 11:52:12 +0200
aims-desktop (2016.12.03) unstable; urgency=medium
* Prune again: most octave-*, some python3-*, left r-cran-* installed
......
aims-collect-support-data.desktop usr/share/applications/
aims-starburst.png usr/share/pixmaps
bin/aims-collect-support-data usr/bin
conf/gsettings/95_aims-desktop.gschema.override usr/share/glib-2.0/schemas/
conf/gsettings/95_dashtodock.gschema.override /usr/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment