Accueil > Linux > matériels : infos et installations > Avoir des infos poussées sur un ordi pour analyse
Avoir des infos poussées sur un ordi pour analyse
Publié le 3 mars 2017, dernière mise-à-jour le 15 octobre 2025, > 33 visites, >> 165987 visites totales.
But :
Avoir des infos poussées sur un ordi pour analyse ultérieure
- chaque fois qu’un problème apparaît, appuyer sur la touche ( impr ecrn / prt screen /Imp écran ) à drotie de F12 qui enregistre une image du bureau. Ne pas hésiter à faire une vidéo ou photo avec son appareil photo/smartphone...
- noter le maximum d’infos sur ce que vous faîtes
- Ici, on va enregistrer plein d’infos en une seule fois : pour les trois solutions , il faudra passer en root (
sudo -ssur ubuntu , puis MotDePasse )
commencerf par installer les prérequis si possible :
apt-get install dmidecode coreutils util-linux mesa-utils grep lshw usbutils util-linux pciutils iproute2 inxi kmod dpkg smartmontools net-tools wireless-tools upower
- solution 1 : en root ou sudo
wget http://dindoun.lautre.net/IMG/zip/br_systeme_sh.zip && unzip br_systeme_sh.zip && sudo bash br_systeme.sh - solution 2 : on copie colle le gros bloc
- on télécharge le zip, on le décompresse et on l’exécute en root ou sudo
- remarque : ca crée un fichier .tar dans tous les /home/machin/Bureau/ et dans /root/ .
Prérequis éventuels
- nécessite une connexion internet
- ouvrir un terminal root
- ouvrir un terminal
- passer en root (
sudo -ssur ubuntu , puis MotDePasse )
- installer les programmes
apt-get install dmidecode coreutils util-linux mesa-utils grep lshw usbutils util-linux pciutils iproute2 inxi kmod dpkg smartmontools net-tools wireless-tools upower
le long fichier à télécharger qui correspond à totues les lignes du dessous
be4612a4ee862be7ab9ffba79f76c154b91b54e811acd7e87b7d02fca6c43adb
Commandes :
– copier/coller les lignes suivantes en une fois :
#!bin/bash
Version='2.4.1'
#241 ajout de quleques trucs imprimantes ; rangement MATERIEL/USB### et MATERIEL/IMPRIMANTE###
#240 timedatectl ; /etc/apt/sources.list /etc/apt/sources.list.d/*list
#239 materiel:hwprobe https://linux-hardware.org sudo -E hw-probe -all -upload
#238 udevadm
#224 fin du IFS USER1000 VERSION_ID plus de debian_version sur le tar (car bullseye/sid)
#afaire: rajouter une copie d ecran, copier tout /etc
#228 amelioration du son
#226 cp -a /etc/* ETC
#224 creation de Bureau/, ajout de version et debian_version sur le .tar
if [ $(whoami) != "root" ];then echo "il vaut mieux etre en root";fi
debian_version=$(cat /etc/debian_version)
VERSION_ID=$(cat /etc/os-release |grep VERSION_ID |sed 's#.*"\(.*\)".*#\1#')
USER1000=$(grep 1000 /etc/passwd |sed 's#:.*##')
temps=$(date +%Y.%m.%d.%H.%M.%S)
echo "version : "$Version
echo "apt-get install aptitude dmidecode coreutils util-linux mesa-utils grep lshw lynis usbutils util-linux pciutils iproute2 inxi kmod dpkg smartmontools ethtool net-tools wireless-tools upower"
for programme in {aptitude,dmidecode,coreutils,util-linux,mesa-utils,grep,lshw,lynis,usbutils,util-linux,pciutils,iproute2,inxi,kmod,dpkg,smartmontools,ethtool,net-tools,wireless-tools,upower};do apt-get -y install "$programme";apt-get -f -y install ;done
#i="ifconfig";apt-file search $i |grep "\ $(which $i)$"
cd /tmp/ && mkdir -p br_SYSTEME/$(hostname)_$temps && cd br_SYSTEME/$(hostname)_$temps && echo "version : "$Version >> "_version"$Version
ls -A /home > USERS
egrep -v "false$|nologin$|null" /etc/passwd |egrep ":x:" >> USERS
egrep -v "false$|nologin$|null" /etc/passwd |egrep -v ":x:" |sed 's/:.*:/:MotDePasseDansPasswd:/' >> USERS
egrep -v "false$|nologin$|null" /etc/passwd |egrep -v ":x:" |sed 's/:.*:/:MotDePasseDansPasswd:/' >> aa_ERREURS
touch aa_RESUMEE
inxi -M -c 0 >> aa_RESUMEE
mkdir LOGS VIDEO SYSTEME MATERIEL HD RESEAU PROGRAMMES SON GRUB LAPTOP BUREAU SESSION ETC
cp -a /etc/* ETC
import -window root BUREAU/BUREAU.jpg
dmesg > LOGS/dmesg
cat LOGS/dmesg|egrep -i "error|warning|Reason">> aa_ERREURS
echo "############################ SESSION"
cat /etc/X11/default-display-manager >> SESSION/default-display-manager-lightdm-gdm-mdm
systemctl status lightdm >> SESSION/systemctl-status-lightdm
cat /home/*/.xsession /home/*/.xsession-errors >> SESSION/xsession
cat SESSION/xsession |egrep -i "unable to start X session|aborting" >> aa_ERREURS
cp /var/log/boot.log LOGS/boot.log
echo -e "-------\nboot.log" >> aa_ERREURS
cat /var/log/boot.log |grep FATAL >> aa_ERREURS
echo -e "" >> aa_ERREURS
echo "############################ VIDEO"
cp /var/log/Xorg.0.log VIDEO/Xorg.0.log
cp /etc/X11/xorg.conf VIDEO/xorg.conf
glxinfo > VIDEO/glxinfo
glxinfo |grep rendering >> aa_RESUMEE
err=""
err=$(echo -n "-------glxinfo :")
err=$err$(egrep "direct rendering" VIDEO/glxinfo )
err=$(echo $err |grep -v "direct rendering: Yes")
echo $err >> aa_ERREURS
err=""
echo -e "-------\nXorg.0.log " >> aa_ERREURS
egrep "\(EE\)|\(WW\)|\(NI\)" /var/log/Xorg.0.log >> aa_ERREURS
echo -e "" >> aa_ERREURS
################################## MATERIEL
echo "############################ MATERIEL"
inxi -M -c 0 > MATERIEL/inxi-m
cat MATERIEL/inxi-m >> aa_RESUMEE
lshw > MATERIEL/lshw
lscpu > MATERIEL/lscpu
cat /proc/cpuinfo > MATERIEL/proc_cpuinfo
lsusb > MATERIEL/USB_lsusb
ln -s MATERIEL/USB_lsusb MATERIEL/lsusb
lsusb -v > MATERIEL/USB_lsusb-v
ln -s MATERIEL/USB_lsusb-v MATERIEL/lsusb-v
lsusb -t > MATERIEL/USB_lsusb-t
ln -s MATERIEL/USB_lsusb-t MATERIEL/lsusb-t
ls -l /dev/bus/usb/*/* >MATERIEL/USB_dev_bus_usb__
lspci > MATERIEL/lspci
lspci -nnvvv > MATERIEL/lspci-nnvvv
#lspci -k > MATERIEL/lspci-k #deja dans la ligne lspci -nnvvv
cat MATERIEL/lspci |egrep "vga|ATI|NVIDIA" >> aa_RESUMEE #cat
echo "/etc/default/crda" $(cat /etc/default/crda |grep "REGDOMAIN=") >> aa_RESUMEE
cp /etc/default/keyboard MATERIEL/clavier_etc_default_keyboard
cat /etc/printcap > MATERIEL/IMPRIMANTES_etc_printcap_imprimantes
ln -s MATERIEL/IMPRIMANTES_etc_printcap_imprimantes MATERIEL/etc_printcap_imprimantes
ls /etc/cups/ppd/ > MATERIEL/IMPRIMANTES_etc_cups_ppd_
egrep -i "name|model|filter" /etc/cups/ppd/* > MATERIEL/IMPRIMANTES_etc_cups_ppd_filtree
cat /proc/ioports > MATERIEL/proc_ioports_usb_pci_vga_dma
################################## DISQUES DURS
echo "############################ DISQUES DURS"
find /dev/sd* /dev/mmcblk* /dev/nvmen* |while read device;do echo -e "\n\n$device\n" ;udevadm info "$device" >> MATERIEL/udevadm;done
cp /etc/fstab HD/fstab
cp /etc/mtab HD/mtab
df -h > HD/df-h
################################## GRUB
echo "############################ GRUB"
cp /etc/default/grub GRUB/grub
cp /boot/grub/menu.lst GRUB/menu.lst
cp /boot/grub/grub.cfg GRUB/grub.cfg
for i in $(ls /etc/grub.d/*)
do cp "$i" "GRUB/etc_grub.d_$(basename $i)"
done
################################## SYSTEME DIVERS
echo "############################ SYSTEME DIVERS"
cat /etc/os-release > SYSTEME/os_release
cat /etc/*release >> SYSTEME/release
export > SYSTEME/export
printenv > SYSTEME/printenv
printenv |grep "_proxy" >> aa_ERREURS
cat /etc/environment > SYSTEME/environment
cat /etc/apt/sources.list /etc/apt/sources.list.d/*list > SYSTEME/sources.list
ls -al /dev/disk/by-uuid > SYSTEME/dev_disk_by-uuid
uname -r -m > SYSTEME/uname-r-m
uname -m > SYSTEME/uname-m
cat /etc/debian_version > SYSTEME/debian_version
cat /proc/version > SYSTEME/proc_version
inxi -S -c 0 > SYSTEME/inxi-S
ps aux > SYSTEME/ps_aux
cat /proc/cmdline > SYSTEME/proc_cmdline
cat /etc/modules > SYSTEME/modules
lsmod > SYSTEME/lsmod
cat /proc/modules > SYSTEME/proc_modules
for i in $(ls /etc/modprobe.d/*);do cp $i SYSTEME/modprobe.d_$(basename $i);done
dmidecode > SYSTEME/dmidecode
dpkg --get-selections > SYSTEME/dpkg-get-selections
dpkg -l > SYSTEME/dpkg-l
history|grep apt-get > SYSTEME/dpkg-history_apt-get
aptitude search '?narrow(?installed, ?not(?origin(Debian)))' >> SYSTEME/dpkg-paquets_externes
cat /proc/interrupts > SYSTEME/proc_interrupts_irq
cat /proc/mounts > SYSTEME/proc_mounts
ls -al /home > SYSTEME/home
for i in $(ls -Al /dev/disk/by-id/|grep -v [0-9]$ |sed 's#.*/\(sd.*\)#\1#'|sort|uniq)
do echo "==================== "/dev/$i" ===========================" >> SYSTEME/smartctl
smartctl -A /dev/$i >> SYSTEME/smartctl
done
lynis audit system > SYSTEME/lynis_audit_system
uname -m >> aa_RESUMEE
uname -r -m >> aa_RESUMEE
cat /etc/debian_version>> aa_RESUMEE
inxi -S -c 0 >> aa_RESUMEE
for i in $(ls -Al /dev/disk/by-id/|grep -v [0-9]$|sed 's#.*/\(sd.*\)#\1#'|sort|uniq); do echo /dev/$i ":" $(smartctl -H /dev/$i |grep test)>>aa_RESUMEE;done
timedatectl >> SYSTEME/timedatectl
################################## RESEAU https://wiki.debian.org/fr/NetworkConfiguration
echo "############################ RESEAU"
ls /sys/class/net > RESEAU/sys_class_net
cat /etc/resolv.conf > RESEAU/resolv.conf
ifconfig -a > RESEAU/ifconfig-a
ip a >> RESEAU/ifconfig-a
iwconfig> RESEAU/iwconfig
iwlist scan > RESEAU/iwlist_scan
cp /etc/NetworkManager/nm-system-settings.conf RESEAU/etc_NetworkManager_nm-system-settings.conf
cp /etc/NetworkManager/NetworkManager.conf RESEAU/etc_NetworkManager_NetworkManager.conf
cat /etc/default/crda > RESEAU/WIFI-crda
cat RESEAU/WIFI-crda |egrep -i "REGDOMAIN=$" >> aa_ERREURS
cat /etc/network/interfaces > RESEAU/interfaces
for i in $(ls /etc/NetworkManager/system-connections/*)
do cp "$i" "RESEAU/etc_NetworkManager_system-connections_$(basename $i)"
done
ip a |egrep "inet\ [0-9\.]*|^[0-9]" |sed -e "s#^[0-9]\:\ \(.*\)\:.*<.*#\1#" -e "s#.*inet\ \([0-9\.]*\)/[0-9].*#\1#">>aa_RESUMEE
ifconfig -a |egrep "inet\ [0-9\.]*|: flags" |sed -e "s#:\ flags.*#:#" -e "s#.*inet\ \([0-9\.]*\)\ .*#\1#">>aa_RESUMEE
#debian handbook p205
echo "netdev : "$(grep netdev /etc/group) >> RESEAU/netdev
cp /etc/nsswitch.conf RESEAU/etc_nsswitch.conf
route -vn >> RESEAU/route-route-vn
ip -4 route >> RESEAU/route-ip-4-route
ip -6 route >> RESEAU/route-ip-6-route
# /etc/profile.d/proxy.sh /etc/apt/apt.conf.d/99HttpProxy /etc/wgetrc /etc/apt/apt.conf
mkdir -p BUREAU/usr_share_applications_/
cp -a /usr/share/applications/ BUREAU/usr_share_applications_/
cp /usr/share/applications/*.list BUREAU/
cp -a /home/*/.local/share/*/scripts/ BUREAU/
################################## son
echo "################################## SON"
mkdir -p SON
cat /proc/asound/version > SON/proc_asound_version
cat /proc/asound/cards > SON/proc_asound_cards
cat SON/proc_asound_cards |grep "no soundcards" >> aa_ERREURS
cat /proc/asound/devices > SON/proc_asound_devices
cat /proc/asound/oss/devices >> SON/proc_asound_oss_devices
cat /proc/asound/timers > SON/proc_asound_timers
cat /proc/asound/pcm > SON/proc_asound_pcm
#obsolete??
alsactl init > SON/alsactl_init
lshw -C sound > SON/lshw_sound
lsof /dev/dsp > SON/lsof_dev_dsp
lsof /dev/snd/* > SON/lsof_dev_snd
fuser /dev/snd/pcmC0D0p > SON/fuser_dev_snd_pcmC0D0p
fuser /dev/snd/pcm* >> SON/fuser_dev_snd_pcm
lspci |grep -i audio > SON/lspci_audio
for DomBusFun in $(cat SON/lspci_audio|sed "s/\ .*//g");do lspci -s "$DomBusFun" -nnvvv > SON/lspci_"$DomBusFun" ;done
dmesg |egrep 'sound|snd' > SON/dmesg_SoundOuSnd
ps aux |egrep "pulse|alsa" |grep -v grep > SON/ps_aux_PulseOuAlsa
cat /home/*/.asoundrc /root/.asoundrc >> SON/asoundrc
upower -d> LAPTOP/upower-d
echo -n "batterie portable : " >> aa_RESUMEE ; cat LAPTOP/upower-d|grep "capacity:" >> aa_RESUMEE
update-flashplugin-nonfree --status >> PROGRAMMES/flashplayer_status
echo -e '\n---------------------------ERREURS a verifier-----\n' >> aa_RESUMEE
cat aa_ERREURS >> aa_RESUMEE
tree -H . > tree.html
cp aa_ERREURS aa_RESUMEE /tmp/
cd /tmp/
tar -cvf br_SYSTEME/$(hostname)_${VERSION_ID}_${USER1000}_${temps}_V${Version}.tar br_SYSTEME/$( hostname )_$temps/
chmod -R 777 br_SYSTEME/$( hostname )_$temps*
rm -r br_SYSTEME/$( hostname )_$temps/
for i in $(ls /home/)
do cp br_SYSTEME/$( hostname )*.tar /home/$i/Bureau/
cp br_SYSTEME/$( hostname )*.tar /home/$i/Desktop/
chmod 777 /home/$i/*/$( hostname )*.tar
done
cp br_SYSTEME/$( hostname )*.tar /root/
echo -e '\n---------------------------début de ERREURS a verifier----=> \n'
cat aa_ERREURS
echo -e '\n <=-------------------------fin de ERREURS a verifier-----\n'
#V2.1.2 : affichage des erreurs
echo -e "\n\nversion :"$Version
echo -e "REMARQUE : il est normal qu'il y ait des ERREURS\nIl faut maintenant m'envoyer le fichier br_systeme...tar qui est sur le Bureau"
echo -e " on peut utiliser les fichiers /tmp/aa_ERREURS /tmp/aa_RESUMEE"
echo -e "attention les fichiers dans le dossier RESEAU pourraient contenir des mots de passe en clair."
1ère version : mardi 14 novembre 2006