Tuxedo Computer : Script bash pour comprendre pourquoi le bruit du ventilateur

230 x served & 59 x viewed

Voici donc le script que j’ai fait :

#!/bin/bash

#
# MariaDB [mysql]> create database CPU;
# Query OK, 1 row affected (0.00 sec)

# MariaDB [(none)]> CREATE USER 'arias'@'localhost' IDENTIFIED BY 'arias';
# Query OK, 0 rows affected (0.00 sec)

# MariaDB [(none)]> GRANT USAGE ON *.* TO 'arias'@'localhost' IDENTIFIED BY 'arias';
# Query OK, 0 rows affected (0.00 sec)

# MariaDB [(none)]>  GRANT ALL privileges ON CPU.* TO 'arias'@'localhost';
# Query OK, 0 rows affected (0.00 sec)

# MariaDB [(none)]> FLUSH PRIVILEGES;
# Query OK, 0 rows affected (0.00 sec)
#
#
 -u root -e "CREATE DATABASE CPU;"
 -u root -e "USE CPU; CREATE TABLE information (date datetime, cpu float, fanId int, rawFanDuty int, fanDuty float, remoteTemp int, localTemp int);"

CPU_USAGE=$(awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print ($2+$4-u1) * 100 / (t-t1) "%"; }' <(grep 'cpu ' /proc/stat) <(sleep 1;grep 'cpu ' /proc/stat))
DATE=$(date "+%Y-%m-%d %H:%M:%S")
CPU_USAGE_2=$(echo $CPU_USAGE | sed 's/%//g' )
#ff0000;">/usr/bin/tuxedofancontrol --show > /tmp/tuxedofancontrol.out
FANID=$(cat /tmp/tuxedofancontrol.out | grep "fanId" | awk '{print $2}' | sed 's/,//g') 
RAWFANDUTY=$(cat /tmp/tuxedofancontrol.out | grep "rawFanDuty" | awk  '{print $2}' | sed 's/,//g' )
FANDUTY=$(cat /tmp/tuxedofancontrol.out | grep "fanDuty" | awk '{print $2}' | sed 's/,//g')
REMOTETEMP=$(cat /tmp/tuxedofancontrol.out | grep "remoteTemp:" | awk '{print $2}' | sed 's/,//g')
LOCALTEMP=$(cat /tmp/tuxedofancontrol.out | grep "localTemp:" | awk '{print $2}' | sed 's/,//g' )

if [ ! -z $FANID ]
then
        SQL="USE CPU; INSERT INTO information (date, cpu, fanId, rawFanDuty, fanDuty, remoteTemp, localTemp) VALUES ('$DATE',$CPU_USAGE_2,$FANID,$RAWFANDUTY,$FANDUTY,$REMOTETEMP,$LOCALTEMP);"
else
        SQL="USE CPU; INSERT INTO information (date, cpu) VALUES ('$DATE',$CPU_USAGE_2);"
fi

echo $SQL > /tmp/lastsql.out
mysql -u root -e "$SQL"

C’est assez simple, je prends la date et l’utilisation du CPU. Et aussi je note toutes les informations de tuxedofancontrol.
J’ai mis le script toutes les 2 minutes dans ma crontab, ensuite je ferai un script pour Grafana.

$ sudo crontab -l
*/2 * * * * /home/arias/Bash/cpu.bash

Par exemple :

A suivre.

Visiblement je ne suis pas le seul à trouver le ventilateur un peu trop bruyant : https://www.tuxedocomputers.com/en/Infos/Help-Support/Frequently-asked-questions/Why-is-the-ventilator-so-loud-.tuxedo .

#ff0000;">Why is the ventilator so loud?

IMPORTANT: There are ventilation slots on the bottom side through which the ventilator(s) suck in air. Never place your notebook on a pillow, couch, bed, blanket or tablecloth. In the worst case scenario, the notebook can overheat and cause serious damage.

#ff0000;">The ventilator noise depends largely on the system load. If the processor has to work a lot, it consumes a lot of power, which leads to increased waste heat that somehow has to be cooled. If the ventilation slots are covered, the ventilator(s) cannot suck in any air. This has a negative effect on the cooling performance, the ventilator(s) must rotate faster to provide sufficient cooling and the noise level is significantly higher.

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée.

Time limit is exhausted. Please reload CAPTCHA.