Skip to content

Instantly share code, notes, and snippets.

@pcostesi
Last active December 13, 2015 21:08
Show Gist options
  • Save pcostesi/4974647 to your computer and use it in GitHub Desktop.
Save pcostesi/4974647 to your computer and use it in GitHub Desktop.
regnum diag script
#!/bin/bash
clear
echo Juntando información
DATE=$(date --rfc-3339=date)
LOGFILE=~/regnum-$DATE.txt
CPU=$(cat /proc/cpuinfo | grep -i "model name")
MHZ=$(cat /proc/cpuinfo | grep 'cpu MHz')
CACHE=$(cat /proc/cpuinfo | grep 'cache size')
KERNEL=$(uname -a)
ARCH=$(uname -m)
ARCH_VERSION=$(cat /etc/$(ls /etc/ | grep -m1 version) || echo "Sin info")
UPTIME=$(uptime || echo "Sin info")
COMPIZ=$(ps aux | grep -i "compiz" | grep -iv "grep" || echo "No se ejecuta")
VGA=$($(which lspci) | grep VGA || echo "Sin VGA disponible")
ACCEL=$($(which glxinfo) | grep -i "direct rend" || echo "Sin info")
OPENGL=$((glxinfo | grep -i 'opengl') || echo "Sin info")
S3TC=$( (glxinfo | grep -i 's3tc')|| echo "No habilitadas")
LOAD=$(cat /etc/X11/xorg.conf | grep Load| grep -v '#' | cut -d'"' -f2 | cut -d'"' -f1 | grep "" || echo "No se detectan secciones Load")
DRIVERS=$(cat /etc/X11/xorg.conf | grep Driver | grep -v '#'| cut -d'"' -f2 | cut -d'"' -f1 | grep "" || echo "No se detectaron drivers")
MEM=$(cat /proc/meminfo | grep -i "MemTotal" | cut -d: -f2 | grep -m1 "" || echo "Sin info")
FREEMEM=$(cat /proc/meminfo | grep -i "MemFree" | cut -d: -f2 | grep -m1 "" || echo "Sin info")
SENSORS=$(sensors || echo "No hay sensores")
HDD=$(df -hP || echo "No hay info")
XORGLOG=$(cat /var/log/Xorg.0.log | grep -i "(EE)\|(WW)")
touch $LOGFILE
cat << _EOF > $LOGFILE
Informe generado el día $DATE
++++++CPU+++++
$CPU
$MHZ
$CACHE
++++++Distro+++++
Kernel: $KERNEL
Arquitectura: $ARCH
Carga y uptime: $UPTIME
Beryl: $COMPIZ
++++++Placa de video+++++
Hardware: $VGA
Aceleración (Direct Rendering): $ACCEL
OpenGL: $OPENGL
Extensiones S3TC: $S3TC
++++++Xorg.conf++++++
Load: $LOAD
Drivers: $DRIVERS
++++++RAM+++++
Memoria total: $MEM
Memoria libre: $FREEMEM
++++++sensores+++++
$SENSORS
++++++HDD+++++
$HDD
++++++Log de Xorg+++++
$XORGLOG
++++++++++++++++++++++

_EOF
echo "Información disponible en $LOGFILE"
cat $LOGFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment