#51 Le 20/02/2020, à 15:23
- Mia98
Re : Smartmontools n'envoie pas les mails
il me semble que maintenant tu reçois bien les émails
Tout à fait, c'était mon adresse Gmail qui bloquait, avec Free c'est bon.
J'étais repartie sur le script hebdomadaire de grandtoutlab, du fait que smartd n'envoie un mail qu'en cas de nouvelles erreurs, et me rends compte qu'à avoir mélangé 2 façons de faire, on ne sait plus de laquelle on parle...
Merci pour ton fichier de configuration, et toute l'aide que tu m'as apportée.
Bonne journée à tous
Hors ligne
#52 Le 20/02/2020, à 15:37
- geole
Re : Smartmontools n'envoie pas les mails
mia@mia-PC5:~$ sudo smartctl -a /dev/sda smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-76-generic] (local build) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Family: Seagate Desktop SSHD Device Model: ST1000DX001-1CM162 Serial Number: Z1DD25RC LU WWN Device Id: 5 000c50 0792cf436 Firmware Version: CC43 User Capacity: 1000204886016 bytes [1,00 TB] Sector Sizes: 512 bytes logical, 4096 bytes physical Rotation Rate: 7200 rpm Form Factor: 3.5 inches Device is: In smartctl database [for details use: -P show] ATA Version is: ACS-2, ACS-3 T13/2161-D revision 3b SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s) Local Time is: Wed Feb 19 16:37:45 2020 CET SMART support is: Available - device has SMART capability. SMART support is: Enabled === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED General SMART Values: Offline data collection status: (0x82) Offline data collection activity was completed without error. Auto Offline Data Collection: Enabled. Self-test execution status: ( 0) The previous self-test routine completed without error or no self-test has ever been run. Total time to complete Offline data collection: ( 575) seconds. Offline data collection capabilities: (0x7b) SMART execute Offline immediate. Auto Offline data collection on/off support. Suspend Offline collection upon new command. Offline surface scan supported. Self-test supported. Conveyance Self-test supported. Selective Self-test supported. SMART capabilities: (0x0003) Saves SMART data before entering power-saving mode. Supports SMART auto save timer. Error logging capability: (0x01) Error logging supported. General Purpose Logging supported. Short self-test routine recommended polling time: ( 1) minutes. Extended self-test routine recommended polling time: ( 109) minutes. Conveyance self-test routine recommended polling time: ( 2) minutes. SCT capabilities: (0x1081) SCT Status supported. SMART Attributes Data Structure revision number: 10 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000f 116 099 006 Pre-fail Always - 107195664 3 Spin_Up_Time 0x0003 097 097 000 Pre-fail Always - 0 4 Start_Stop_Count 0x0032 099 099 020 Old_age Always - 1063 5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 16 7 Seek_Error_Rate 0x000f 084 060 030 Pre-fail Always - 252183893 9 Power_On_Hours 0x0032 068 068 000 Old_age Always - 28171 10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 099 099 020 Old_age Always - 1120 183 Runtime_Bad_Block 0x0032 100 100 000 Old_age Always - 0 184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0 187 Reported_Uncorrect 0x0032 050 050 000 Old_age Always - 50 188 Command_Timeout 0x0032 100 099 000 Old_age Always - 0 0 7 189 High_Fly_Writes 0x003a 100 100 000 Old_age Always - 0 190 Airflow_Temperature_Cel 0x0022 060 048 045 Old_age Always - 40 (Min/Max 29/40) 191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 0 192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 51 193 Load_Cycle_Count 0x0032 099 099 000 Old_age Always - 2470 194 Temperature_Celsius 0x0022 040 052 000 Old_age Always - 40 (0 17 0 0 0) 197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0 198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0 240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 28007h+35m+46.832s 241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 24330555579 242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 205005570791 SMART Error Log Version: 1 ATA Error Count: 5 CR = Command Register [HEX] FR = Features Register [HEX] SC = Sector Count Register [HEX] SN = Sector Number Register [HEX] CL = Cylinder Low Register [HEX] CH = Cylinder High Register [HEX] DH = Device/Head Register [HEX] DC = Device Command Register [HEX] ER = Error register [HEX] ST = Status register [HEX] Powered_Up_Time is measured from power on, and printed as DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes, SS=sec, and sss=millisec. It "wraps" after 49.710 days. Error 5 occurred at disk power-on lifetime: 25014 hours (1042 days + 6 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 00 ff ff ff 0f Error: WP at LBA = 0x0fffffff = 268435455 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 61 00 10 ff ff ff 4f 00 00:38:14.385 WRITE FPDMA QUEUED 61 00 08 ff ff ff 4f 00 00:38:14.385 WRITE FPDMA QUEUED 60 00 08 ff ff ff 4f 00 00:38:14.384 READ FPDMA QUEUED 60 00 80 ff ff ff 4f 00 00:38:13.971 READ FPDMA QUEUED 61 00 01 ff ff ff 4f 00 00:38:13.953 WRITE FPDMA QUEUED Error 4 occurred at disk power-on lifetime: 25014 hours (1042 days + 6 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 00 ff ff ff 0f Error: UNC at LBA = 0x0fffffff = 268435455 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 60 00 80 ff ff ff 4f 00 00:38:10.088 READ FPDMA QUEUED 60 00 00 ff ff ff 4f 00 00:38:10.088 READ FPDMA QUEUED 60 00 80 ff ff ff 4f 00 00:38:10.088 READ FPDMA QUEUED 60 00 80 ff ff ff 4f 00 00:38:10.086 READ FPDMA QUEUED 60 00 00 ff ff ff 4f 00 00:38:10.083 READ FPDMA QUEUED Error 3 occurred at disk power-on lifetime: 25013 hours (1042 days + 5 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 00 08 83 67 03 Error: UNC at LBA = 0x03678308 = 57115400 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 60 00 80 00 86 67 43 00 00:03:55.854 READ FPDMA QUEUED 60 00 80 00 29 67 43 00 00:03:55.312 READ FPDMA QUEUED 60 00 00 00 24 67 43 00 00:03:55.308 READ FPDMA QUEUED 60 00 00 00 1f 67 43 00 00:03:55.305 READ FPDMA QUEUED 60 00 80 80 1e 67 43 00 00:03:55.303 READ FPDMA QUEUED Error 2 occurred at disk power-on lifetime: 25013 hours (1042 days + 5 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 00 f8 c0 66 03 Error: UNC at LBA = 0x0366c0f8 = 57065720 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 60 00 08 f8 c0 66 43 00 00:03:51.277 READ FPDMA QUEUED 60 00 08 f0 c0 66 43 00 00:03:51.277 READ FPDMA QUEUED 60 00 08 e8 c0 66 43 00 00:03:51.277 READ FPDMA QUEUED 60 00 08 e0 c0 66 43 00 00:03:51.277 READ FPDMA QUEUED 60 00 08 d8 c0 66 43 00 00:03:51.276 READ FPDMA QUEUED Error 1 occurred at disk power-on lifetime: 25013 hours (1042 days + 5 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 00 f8 c0 66 03 Error: UNC at LBA = 0x0366c0f8 = 57065720 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 60 00 00 80 c1 66 43 00 00:03:47.634 READ FPDMA QUEUED 60 00 00 80 83 66 43 00 00:03:46.958 READ FPDMA QUEUED 60 00 80 00 80 66 43 00 00:03:46.676 READ FPDMA QUEUED 60 00 00 00 7e 66 43 00 00:03:46.676 READ FPDMA QUEUED 60 00 80 80 80 45 43 00 00:03:41.111 READ FPDMA QUEUED SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Short offline Completed without error 00% 28154 - # 2 Short offline Completed without error 00% 28150 - # 3 Short offline Completed without error 00% 28127 - # 4 Short offline Completed without error 00% 28121 - # 5 Short offline Completed without error 00% 28088 - # 6 Short offline Completed without error 00% 28056 - # 7 Short offline Completed without error 00% 28053 - # 8 Short offline Completed without error 00% 28050 - # 9 Short offline Completed without error 00% 28049 - #10 Short offline Completed without error 00% 28047 - #11 Short offline Completed without error 00% 28045 - #12 Short offline Completed without error 00% 28044 - #13 Short offline Completed without error 00% 28043 - #14 Short offline Completed without error 00% 28042 - #15 Short offline Completed without error 00% 28041 - #16 Short offline Completed without error 00% 28040 - #17 Short offline Completed without error 00% 28040 - #18 Short offline Completed without error 00% 28039 - #19 Short offline Completed without error 00% 28038 - #20 Short offline Completed without error 00% 28037 - #21 Short offline Completed without error 00% 28036 - SMART Selective self-test log data structure revision number 1 SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS 1 0 0 Not_testing 2 0 0 Not_testing 3 0 0 Not_testing 4 0 0 Not_testing 5 0 0 Not_testing Selective self-test flags (0x0): After scanning selected spans, do NOT read-scan remainder of disk. If Selective self-test is pending on power-up, resume after 0 minute delay.
Mon avis pour ce disque.
Il a eu un petit problème vers la 25014 eme heure de fonctionnement avec 5 erreurs détectées. Mais le mécanisme des blocs deffectueux fonctionne bien puisque qu'il n'y en a pas actuellent.
Il y a eu 16 secteurs de réalloués. C'est certainbemlent en lien avec cet incident.
Il a maintenant 28171 heures de fonctionnement. Cela fait donc plus de 3000 heures qu'il n'y a pas eu d'incident.
En revanche, la partie mécanique (La tête de lecture) fatigue. C'est visible avec ces deux compteurs. Cependant rien d'inquiétant.
1 Raw_Read_Error_Rate 0x000f 116 099 006 Pre-fail Always -
7 Seek_Error_Rate 0x000f 084 060 030 Pre-fail Always -
Pour le second compteur, son efficacité actuelle est de 84% , il a même descendu à 60% . Mais d'inquitude à avoir tant que cela est supérieur à 30%
sudo smartctl -a /dev/sdb smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-76-generic] (local build) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Family: Seagate Desktop SSHD Device Model: ST1000DX001-1CM162 Serial Number: Z1DD26MH LU WWN Device Id: 5 000c50 0792ce7ac Firmware Version: CC43 User Capacity: 1000204886016 bytes [1,00 TB] Sector Sizes: 512 bytes logical, 4096 bytes physical Rotation Rate: 7200 rpm Form Factor: 3.5 inches Device is: In smartctl database [for details use: -P show] ATA Version is: ACS-2, ACS-3 T13/2161-D revision 3b SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s) Local Time is: Wed Feb 19 16:38:41 2020 CET SMART support is: Available - device has SMART capability. SMART support is: Enabled === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED General SMART Values: Offline data collection status: (0x82) Offline data collection activity was completed without error. Auto Offline Data Collection: Enabled. Self-test execution status: ( 0) The previous self-test routine completed without error or no self-test has ever been run. Total time to complete Offline data collection: ( 575) seconds. Offline data collection capabilities: (0x7b) SMART execute Offline immediate. Auto Offline data collection on/off support. Suspend Offline collection upon new command. Offline surface scan supported. Self-test supported. Conveyance Self-test supported. Selective Self-test supported. SMART capabilities: (0x0003) Saves SMART data before entering power-saving mode. Supports SMART auto save timer. Error logging capability: (0x01) Error logging supported. General Purpose Logging supported. Short self-test routine recommended polling time: ( 1) minutes. Extended self-test routine recommended polling time: ( 106) minutes. Conveyance self-test routine recommended polling time: ( 2) minutes. SCT capabilities: (0x1081) SCT Status supported. SMART Attributes Data Structure revision number: 10 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000f 117 099 006 Pre-fail Always - 155987456 3 Spin_Up_Time 0x0003 097 097 000 Pre-fail Always - 0 4 Start_Stop_Count 0x0032 099 099 020 Old_age Always - 1067 5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 56 7 Seek_Error_Rate 0x000f 083 060 030 Pre-fail Always - 204473115 9 Power_On_Hours 0x0032 068 068 000 Old_age Always - 28167 10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 099 099 020 Old_age Always - 1120 183 Runtime_Bad_Block 0x0032 100 100 000 Old_age Always - 0 184 End-to-End_Error 0x0032 100 100 099 Old_age Always - 0 187 Reported_Uncorrect 0x0032 001 001 000 Old_age Always - 104 188 Command_Timeout 0x0032 100 099 000 Old_age Always - 0 0 8 189 High_Fly_Writes 0x003a 098 098 000 Old_age Always - 2 190 Airflow_Temperature_Cel 0x0022 065 050 045 Old_age Always - 35 (Min/Max 27/35) 191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 0 192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 51 193 Load_Cycle_Count 0x0032 099 099 000 Old_age Always - 2079 194 Temperature_Celsius 0x0022 035 050 000 Old_age Always - 35 (0 17 0 0 0) 197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0 198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0 240 Head_Flying_Hours 0x0000 100 253 000 Old_age Offline - 28031h+07m+24.084s 241 Total_LBAs_Written 0x0000 100 253 000 Old_age Offline - 50630617162 242 Total_LBAs_Read 0x0000 100 253 000 Old_age Offline - 158059870532 SMART Error Log Version: 1 ATA Error Count: 1 CR = Command Register [HEX] FR = Features Register [HEX] SC = Sector Count Register [HEX] SN = Sector Number Register [HEX] CL = Cylinder Low Register [HEX] CH = Cylinder High Register [HEX] DH = Device/Head Register [HEX] DC = Device Command Register [HEX] ER = Error register [HEX] ST = Status register [HEX] Powered_Up_Time is measured from power on, and printed as DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes, SS=sec, and sss=millisec. It "wraps" after 49.710 days. Error 1 occurred at disk power-on lifetime: 13660 hours (569 days + 4 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 00 c8 f4 5e 09 Error: UNC at LBA = 0x095ef4c8 = 157217992 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 60 00 00 80 f7 5e 49 00 5d+14:32:53.424 READ FPDMA QUEUED 60 00 80 00 f2 5e 49 00 5d+14:32:53.424 READ FPDMA QUEUED 60 00 80 80 f1 5e 49 00 5d+14:32:53.416 READ FPDMA QUEUED 61 00 a8 28 de 72 4a 00 5d+14:32:53.415 WRITE FPDMA QUEUED 61 00 08 ff ff ff 4f 00 5d+14:32:53.415 WRITE FPDMA QUEUED SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Short offline Completed without error 00% 28147 - # 2 Short offline Completed without error 00% 28146 - # 3 Short offline Completed without error 00% 28123 - # 4 Short offline Completed without error 00% 28042 - # 5 Short offline Completed without error 00% 28041 - # 6 Short offline Completed without error 00% 28040 - # 7 Short offline Completed without error 00% 28039 - # 8 Short offline Completed without error 00% 28038 - # 9 Short offline Completed without error 00% 28037 - #10 Short offline Completed without error 00% 28037 - #11 Short offline Completed without error 00% 28036 - #12 Short offline Completed without error 00% 28035 - #13 Short offline Completed without error 00% 28034 - #14 Short offline Completed without error 00% 28033 - #15 Short offline Completed without error 00% 28032 - #16 Short offline Completed without error 00% 28031 - #17 Short offline Completed without error 00% 28020 - #18 Short offline Completed without error 00% 28012 - #19 Short offline Completed without error 00% 28002 - #20 Short offline Completed without error 00% 27996 - #21 Short offline Completed without error 00% 27943 - SMART Selective self-test log data structure revision number 1 SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS 1 0 0 Not_testing 2 0 0 Not_testing 3 0 0 Not_testing 4 0 0 Not_testing 5 0 0 Not_testing Selective self-test flags (0x0): After scanning selected spans, do NOT read-scan remainder of disk. If Selective self-test is pending on power-up, resume after 0 minute delay.
Pour ce disque, une seule erreur survenue alors qu'il avait 13660 de fonctionnement, Il a maintenant 28167 heures de focntionnement.
On peut penser que cette erreur fut grave et à l'origine du remplacement de 56 secteurs.
Même remarque pour l'usure mécanique. Rien de surprenant le disque étant du même constructeur et ayant quasiment le même âge.
1 Raw_Read_Error_Rate 0x000f 117 099 006 Pre-fail Always -
7 Seek_Error_Rate 0x000f 083 060 030 Pre-fail Always -
En deux mots: Disques normaux.
Complément
9 Power_On_Hours 0x0032 068 068 000 Old_age Always - 28171
9 Power_On_Hours 0x0032 068 068 000 Old_age Always - 28167
Si tu souhaites être alertée pour savoir lorsque la valeur 068 passera à 067 cela devrait être possible.
Une estimation 28170/(100-68) = 880 heures environ.
.
Dernière modification par geole (Le 20/02/2020, à 15:47)
Les grilles de l'installateur https://doc.ubuntu-fr.org/tutoriel/inst … _subiquity
"gedit admin:///etc/fstab" est proscrit, utilisez "pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY xdg-open /etc/fstab" Voir https://doc.ubuntu-fr.org/gedit
Les partitions EXT4 des disques externes => https://forum.ubuntu-fr.org/viewtopic.p … #p22697248
Hors ligne
#53 Le 20/02/2020, à 21:20
- Mia98
Re : Smartmontools n'envoie pas les mails
C'est sympa d'avoir analysé le résultat du test de mes disques
Ton avis est rassurant. D'autant plus rassurant que tu maîtrises le sujet, je suis épatée par ton calcul pour arriver à l'estimation de 880 heures !
J'ai comparé nos fichiers de configuration de postfix, il y a quelques différences.
J'ai toutes ces lignes en plus :
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mailslocaux.org
#alias_maps = hash:/etc/aliases
#alias_database = hash:/etc/aliases
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
myorigin = /etc/mailname
Et pour celles-ci c'est un peu différent, j'ai mis ce que tu as toi en dessous :
mydestination = mailslocaux.org, mailslocaux.org, mia-PC5, localhost.localdomain, localhost
mydestination = $myhostname, Courrier du micro portable, a, localhost.localdomain, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mynetworks = 127.0.0.1/32 xxxx.xxxx.xxxx.2/32 [::1]/128 [xxxx::xxxx:xxxx:xxxx:xxxx]/128
mailbox_size_limit = 0
mailbox_size_limit = 0500000
html_directory = /usr/share/doc/postfix/html
a@a:/etc/postfix$
Je vais modifier mon fichier par petites touches pour qu'il finisse par ressembler au tien, selon le résultat obtenu à chaque changement je ferai ou non marche arrière.
Hors ligne
#54 Le 21/02/2020, à 12:14
- grandtoubab
Re : Smartmontools n'envoie pas les mails
il y a deux dispositifs dont on discute et que tu sembles confondre
-1) un script dans anacrontab qui s'il produit un résultat envoi un mail à root
la periodicité de lancement du script est défini dans anacron
voir mes explications ici https://forum.ubuntu-fr.org/viewtopic.p … #p22224393
-2) le daemon smartd qui fait du polling à intervalle régulier et qui peut envoyer des mails
il n'y aura qu'un seul mail par jour par type d'alerte
on peut réduire l'intervalle de polling à 30 mn per exemple
/etc/default/smartmontools
# Defaults for smartmontools initscript (/etc/init.d/smartmontools)
# This is a POSIX shell fragment
# List of devices you want to explicitly enable S.M.A.R.T. for
# Not needed (and not recommended) if the device is monitored by smartd
#enable_smart="/dev/hda /dev/hdb"
# uncomment to start smartd on system startup
start_smartd=yes
# uncomment to pass additional options to smartd on startup
smartd_opts="--interval=1800"
systemctl status smartd
● smartmontools.service - Self Monitoring and Reporting Technology (SMART) Daemon
Loaded: loaded (/lib/systemd/system/smartmontools.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-02-21 11:01:31 CET; 10min ago
Docs: man:smartd(8)
man:smartd.conf(5)
Main PID: 2135 (smartd)
Status: "Next check of 1 device will start at 11:31:31"
Tasks: 1 (limit: 4278)
Memory: 11.6M
CGroup: /system.slice/smartmontools.service
└─2135 /usr/sbin/smartd -n --interval=1800
févr. 21 11:01:24 debian smartd[2135]: Device: /dev/sda [SAT], found in smartd database: Hitachi Travelstar 7K500
févr. 21 11:01:25 debian smartd[2135]: Device: /dev/sda [SAT], is SMART capable. Adding to "monitor" list.
févr. 21 11:01:25 debian smartd[2135]: Device: /dev/sda [SAT], state read from /var/lib/smartmontools/smartd.Hitachi_HTS725032A9A36>
févr. 21 11:01:25 debian smartd[2135]: Monitoring 1 ATA/SATA, 0 SCSI/SAS and 0 NVMe devices
févr. 21 11:01:25 debian smartd[2135]: Executing test of /etc/smartmontools/smartd_warning.d/10mail to root@localhost ...
févr. 21 11:01:30 debian smartd[2135]: Test of /etc/smartmontools/smartd_warning.d/10mail to root@localhost: successful
févr. 21 11:01:30 debian smartd[2135]: Device: /dev/sda [SAT], initial Temperature is 29 Celsius (Min/Max 34/42)
févr. 21 11:01:30 debian smartd[2135]: Device: /dev/sda [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 58 [>
févr. 21 11:01:30 debian smartd[2135]: Device: /dev/sda [SAT], state written to /var/lib/smartmontools/smartd.Hitachi_HTS725032A9A3>
févr. 21 11:01:31 debian systemd[1]: Started Self Monitoring and Reporting Technology (SMART) Daemon.
Dernière modification par grandtoubab (Le 21/02/2020, à 12:14)
Linux tout seul sur HP Pavilion DV7 et Acer Aspire T650, Canon MG3650 en wifi
Debian 11 Bullseye Gnome/Xorg, Gnome/Wayland avec SDDM
https://bidouilledebian.wordpress.com/
ON M'A VU DANS LE VERCORS, SAUTER A L'ELASTIQUE..... J'AI DANS LES BOTTES DES MONTAGNES DE QUESTIONS....
Hors ligne
#55 Le 21/02/2020, à 14:06
- Mia98
Re : Smartmontools n'envoie pas les mails
Bonjour,
Comme je disais plus haut à geole, c'est de ton script dont je parlais dans mes derniers messages.
Je pensais qu'il présentait l'avantage d'envoyer le résultat par mail dans tous les cas, erreurs ou pas erreur, contrairement au daemon smartd.
C'est pourquoi j'ai été surprise de ta réponse :
Excuse moi d'insister mais ce script m'envoi un résultat de check-up toute les semaines car anacron fait ce travail d'envoi de mail
Tu as raison d'insister, je t'avais répondu plus haut mais le sujet commence à être touffu : je reçois bien les message de root dans Thunderbird avec la création d'un compte movemail, mais uniquement par le Cron Daemon pour clamscan et les mails de test de smartd.
Le cron pour smartctl n'arrive pas jusqu'à la boite de root.
J'ai mis en place une programmation horaire pour avoir le résultat plus rapidement.
Je parlais ci-dessus de ton script hebdomadaire avec anacron.
j'ai déja explique le mail par Anacron
Comme c'est root qui lance les tâches , par defaut la mail est envoyé à root, si le script produit un résultat , sinon si le script n'a rien à dire , bien evidemment il n'' y aura pas de mail
D'après cette réponse, les deux dispositifs, le script dans anacrontab et le daemon smartd n'envoient un mail qu'en cas de nouvelles erreurs, c'est ce que je n'avais pas compris compris
Hors ligne
#56 Le 21/02/2020, à 15:51
- grandtoubab
Re : Smartmontools n'envoie pas les mails
les deux dispositifs, le script dans anacrontab et le daemon smartd n'envoient un mail qu'en cas de nouvelles erreurs, c'est ce que je n'avais pas compris compris
tu n'as rien compris , le script dans anacron n'est pas un script de polling, c'est un script qui exécute des commandes smartctl donc il y a un resultat donc un mail chaque semaine car weekly, ça veut dire hebdomadaire
Dernière modification par grandtoubab (Le 21/02/2020, à 15:53)
Linux tout seul sur HP Pavilion DV7 et Acer Aspire T650, Canon MG3650 en wifi
Debian 11 Bullseye Gnome/Xorg, Gnome/Wayland avec SDDM
https://bidouilledebian.wordpress.com/
ON M'A VU DANS LE VERCORS, SAUTER A L'ELASTIQUE..... J'AI DANS LES BOTTES DES MONTAGNES DE QUESTIONS....
Hors ligne
#57 Le 21/02/2020, à 16:17
- Mia98
Re : Smartmontools n'envoie pas les mails
Je crois qu'on ne se comprend pas, je sais bien que weekly veut dire hebdomadaire, moi j'ai choisi hourly, qui veut dire horaire, pour pouvoir vérifier régulièrement que ça marche avant de passer à daily ou weekly.
Je t'avais mis mon script plus haut, le revoilà :
mia@mia-PC5:~$ cat /etc/cron.hourly/smartctl
#! /bin/bash
#set -e
/usr/sbin/smartctl -t short /dev/sda
/bin/sleep 180
/usr/sbin/smartctl -l selftest /dev/sda
/usr/sbin/smartctl -H /dev/sda
/usr/sbin/smartctl -x /dev/sda
/usr/sbin/smartctl -t short /dev/sdb
/bin/sleep 180
/usr/sbin/smartctl -l selftest /dev/sdb
/usr/sbin/smartctl -H /dev/sdb
/usr/sbin/smartctl -x /dev/sdb
Ici tu me dis que ça n'envoie un mail QUE en cas d'erreur :
j'ai déja explique le mail par Anacron
Comme c'est root qui lance les tâches , par defaut la mail est envoyé à root, si le script produit un résultat , sinon si le script n'a rien à dire , bien evidemment il n'' y aura pas de mail
Et maintenant tu me dis le contraire :
tu n'as rien compris lol lol , le script dans anacron n'est pas un script de polling, c'est un script qui exécute des commandes smartctl donc il y a un resultat donc un mail
Donc j'avais bien compris, tu m'embrouilles
N'empêche que ce script, et on parle bien de ton script qui pour toi est weekley et pour moi houly, n'arrive pas dans la boite de root.
Dernière modification par Mia98 (Le 21/02/2020, à 16:18)
Hors ligne
#58 Le 21/02/2020, à 16:39
- grandtoubab
Re : Smartmontools n'envoie pas les mails
Je crois qu'on ne se comprend pas, je sais bien que weekly veut dire hebdomadaire, moi j'ai choisi hourly, qui veut dire horaire, pour pouvoir vérifier régulièrement que ça marche avant de passer à daily ou weekly.
Je t'avais mis mon script plus haut, le revoilà :
Ici tu me dis que ça n'envoie un mail QUE en cas d'erreur :
grandtoubab a écrit :j'ai déja explique le mail par Anacron
Comme c'est root qui lance les tâches , par defaut la mail est envoyé à root, si le script produit un résultat , sinon si le script n'a rien à dire , bien evidemment il n'' y aura pas de mailEt maintenant tu me dis le contraire :
grantoubab a écrit :tu n'as rien compris lol lol , le script dans anacron n'est pas un script de polling, c'est un script qui exécute des commandes smartctl donc il y a un resultat donc un mail
Donc j'avais bien compris, tu m'embrouilles
N'empêche que ce script, et on parle bien de ton script qui pour toi est weekley et pour moi houly, n'arrive pas dans la boite de root.
c'est toi qui confonds erreur au sens smart , il y a une erreur sur un indicateur et resultat d'un script qui n'est pas forcémént une erreur mais du compte rendu
Verifie d'abord ton script en mode commande
cd /etc/cron.hourly
sudo bash smartctl
ensuite verifie qu'il ya ce script dans hourly
etc/cron.hourly# cat 0anacron
#!/bin/sh
#
# anacron's cron script
#
# This script updates anacron time stamps. It is called through run-parts
# either by anacron itself or by cron.
#
# The script is called "0anacron" to assure that it will be executed
# _before_ all other scripts.
test -x /usr/sbin/anacron || exit 0
anacron -u cron.hourly
les scripts doivent etre exécutables
/etc/cron.hourly$ ls -alrt
total 36
-rw-r--r-- 1 root root 102 juin 11 2015 .placeholder
-rwxr-xr-x 1 root root 312 nov. 5 2017 0anacron
-rwxr-xr-x 1 root root 352 nov. 11 2017 updatedb
-rwxr-xr-x 1 root root 439 févr. 1 13:32 purge-ram-hourly
-rwxr-xr-x 1 root root 325 févr. 21 18:08 tempdisk
enfin verifie anacrontab
cat /etc/anacrontab
# /etc/anacrontab: configuration file for anacron
# See anacron(8) and anacrontab(5) for details.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
HOME=/root
LOGNAME=root
# These replace cron's entries
# périodicité , quelle minute
0 40 cron.hourly run-parts --report /etc/cron.hourly
1 20 cron.daily run-parts --report /etc/cron.daily
7 30 cron.weekly run-parts --report /etc/cron.weekly
@monthly 50 cron.monthly run-parts --report /etc/cron.monthly
Dernière modification par grandtoubab (Le 21/02/2020, à 21:05)
Linux tout seul sur HP Pavilion DV7 et Acer Aspire T650, Canon MG3650 en wifi
Debian 11 Bullseye Gnome/Xorg, Gnome/Wayland avec SDDM
https://bidouilledebian.wordpress.com/
ON M'A VU DANS LE VERCORS, SAUTER A L'ELASTIQUE..... J'AI DANS LES BOTTES DES MONTAGNES DE QUESTIONS....
Hors ligne
#59 Le 21/02/2020, à 19:40
- grandtoubab
Re : Smartmontools n'envoie pas les mails
En guise d'illustration voilà un script que je mets dans hourly
/etc/cron.hourly$ cat tempdisk
#!/bin/bash
#set -x
/usr/sbin/hddtemp /dev/sda > /var/tmp/tempdisk
# numero des caractères à adapter selon la longueur du nom
temp=$(cut -c 36,37 /var/tmp/tempdisk)
t_MAX=70
if [ "$temp" -gt "$t_MAX" ]
then
date > /var/tmp/resul_tempdisk.txt
/usr/bin/mailx -s "Le disque a fondu" root@localhost < /var/tmp/tempdisk
echo ' arrêt disque trop chaud' >> /var/tmp/resul_tempdisk.txt
/sbin/shutdown -h -P now
else
/usr/bin/mailx -s "Température du disque" root@localhost < /var/tmp/tempdisk
fi
/var/tmp$ cat tempdisk
/dev/sda: Hitachi HTS725032A9A364: 42°C
En tant que tel le script ne produit aucun résultat
root@debian:/etc/cron.hourly# bash tempdisk
root@debian:/etc/cron.hourly#
Donc anacron n'envoit pas de mail
mais l'exécution du script en envoi un
Dernière modification par grandtoubab (Le 21/02/2020, à 21:04)
Linux tout seul sur HP Pavilion DV7 et Acer Aspire T650, Canon MG3650 en wifi
Debian 11 Bullseye Gnome/Xorg, Gnome/Wayland avec SDDM
https://bidouilledebian.wordpress.com/
ON M'A VU DANS LE VERCORS, SAUTER A L'ELASTIQUE..... J'AI DANS LES BOTTES DES MONTAGNES DE QUESTIONS....
Hors ligne
#60 Le 21/02/2020, à 21:37
- Mia98
Re : Smartmontools n'envoie pas les mails
Ah voilà, c'est les commandes qu'il me fallait, il y a bien des problèmes, pas de fichier 0anacron dans cron.hourly !
Alors qu'il existe dans tous les autres cron.
J'ai ouvert les fichiers 0anacron dans cron.daily et cron.monthly, ils sont identiques sauf la dernière ligne : pour l'un c'est
anacron -u cron.daily
et pour l'autre
anacron -u cron.daily
Je pense que je pourrais créer le fichier 0anacron dans cron.hourly en mettant
anacron -u cron.hourly
pour la dernière ligne, mais j'ai eu un doute car s'il n'est pas présent par défaut, il doit bien y avoir une raison.
Je ne l'ai pas supprimé par mégarde, je viens de vérifier, j'ai une machine virtuelle LMDE (le système hôte est Linux Mint 19.2), et c'est pareil, seul cron.houly n'a pas de fichier 0anacron.
Je vais donc plutôt déplacer le script dans daily.
mia@mia-PC5:~$ sudo bash smartctl
[sudo] Mot de passe de mia :
/usr/sbin/smartctl: /usr/sbin/smartctl : ne peut exécuter le fichier binaire
mia@mia-PC5:/etc/cron.hourly$ sudo cat 0anacron
cat: 0anacron: Aucun fichier ou dossier de ce type
Et en plus le script n'est pas exécutable
mia@mia-PC5:/etc/cron.hourly$ ls -alrt
total 24
-rw-r--r-- 1 root root 102 nov. 16 2017 .placeholder
-rw-r--r-- 1 root root 330 févr. 15 10:27 smartctl
drwxr-xr-x 161 root root 12288 févr. 20 13:18 ..
drwxr-xr-x 2 root root 4096 févr. 21 20:11 .
Après transfert du script dans le cron.daily, la commande bash smartctl fonctionne correctement :
mia@mia-PC5:/etc$ cd /etc/cron.daily
mia@mia-PC5:/etc/cron.daily$ ls
0anacron apt-compat bsdmainutils dpkg man-db passwd ubuntu-advantage-tools
apport aptitude cracklib-runtime logrotate mlocate smartctl update-notifier-common
mia@mia-PC5:/etc/cron.daily$ cat /etc/anacrontab
# /etc/anacrontab: configuration file for anacron
# See anacron(8) and anacrontab(5) for details.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
HOME=/root
LOGNAME=root
# These replace cron's entries
1 5 cron.daily run-parts --report /etc/cron.daily
7 10 cron.weekly run-parts --report /etc/cron.weekly
@monthly 15 cron.monthly run-parts --report /etc/cron.monthly
mia@mia-PC5:/etc/cron.daily$ sudo bash smartctl
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-76-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine immediately in off-line mode".
Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 1 minutes for test to complete.
Test will complete after Fri Feb 21 18:14:25 2020
Use smartctl -X to abort test.
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-76-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 28190 -
# 2 Short offline Completed without error 00% 28154 -
# 3 Short offline Completed without error 00% 28150 -
# 4 Short offline Completed without error 00% 28127 -
# 5 Short offline Completed without error 00% 28121 -
# 6 Short offline Completed without error 00% 28088 -
# 7 Short offline Completed without error 00% 28056 -
# 8 Short offline Completed without error 00% 28053 -
# 9 Short offline Completed without error 00% 28050 -
#10 Short offline Completed without error 00% 28049 -
#11 Short offline Completed without error 00% 28047 -
#12 Short offline Completed without error 00% 28045 -
#13 Short offline Completed without error 00% 28044 -
#14 Short offline Completed without error 00% 28043 -
#15 Short offline Completed without error 00% 28042 -
#16 Short offline Completed without error 00% 28041 -
#17 Short offline Completed without error 00% 28040 -
#18 Short offline Completed without error 00% 28040 -
#19 Short offline Completed without error 00% 28039 -
#20 Short offline Completed without error 00% 28038 -
#21 Short offline Completed without error 00% 28037 -
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-76-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-76-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Seagate Desktop SSHD
Device Model: ST1000DX001-1CM162
Serial Number: Z1DD25RC
LU WWN Device Id: 5 000c50 0792cf436
Firmware Version: CC43
User Capacity: 1000204886016 bytes [1,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-2, ACS-3 T13/2161-D revision 3b
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Fri Feb 21 18:16:26 2020 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
AAM feature is: Unavailable
APM level is: 254 (maximum performance)
Rd look-ahead is: Enabled
Write cache is: Enabled
ATA Security is: Disabled, NOT FROZEN [SEC1]
Wt Cache Reorder: Unavailable
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 575) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 109) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x1081) SCT Status supported.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAGS VALUE WORST THRESH FAIL RAW_VALUE
1 Raw_Read_Error_Rate POSR-- 118 099 006 - 173549832
3 Spin_Up_Time PO---- 097 097 000 - 0
4 Start_Stop_Count -O--CK 099 099 020 - 1068
5 Reallocated_Sector_Ct PO--CK 100 100 010 - 16
7 Seek_Error_Rate POSR-- 084 060 030 - 252471318
9 Power_On_Hours -O--CK 068 068 000 - 28190
10 Spin_Retry_Count PO--C- 100 100 097 - 0
12 Power_Cycle_Count -O--CK 099 099 020 - 1125
183 Runtime_Bad_Block -O--CK 100 100 000 - 0
184 End-to-End_Error -O--CK 100 100 099 - 0
187 Reported_Uncorrect -O--CK 050 050 000 - 50
188 Command_Timeout -O--CK 100 099 000 - 0 0 7
189 High_Fly_Writes -O-RCK 100 100 000 - 0
190 Airflow_Temperature_Cel -O---K 060 048 045 - 40 (Min/Max 23/40)
191 G-Sense_Error_Rate -O--CK 100 100 000 - 0
192 Power-Off_Retract_Count -O--CK 100 100 000 - 51
193 Load_Cycle_Count -O--CK 099 099 000 - 2475
194 Temperature_Celsius -O---K 040 052 000 - 40 (0 17 0 0 0)
197 Current_Pending_Sector -O--C- 100 100 000 - 0
198 Offline_Uncorrectable ----C- 100 100 000 - 0
199 UDMA_CRC_Error_Count -OSRCK 200 200 000 - 0
240 Head_Flying_Hours ------ 100 253 000 - 28027h+16m+41.819s
241 Total_LBAs_Written ------ 100 253 000 - 24357692564
242 Total_LBAs_Read ------ 100 253 000 - 205162163100
||||||_ K auto-keep
|||||__ C event count
||||___ R error rate
|||____ S speed/performance
||_____ O updated online
|______ P prefailure warning
General Purpose Log Directory Version 1
SMART Log Directory Version 1 [multi-sector log support]
Address Access R/W Size Description
0x00 GPL,SL R/O 1 Log Directory
0x01 SL R/O 1 Summary SMART error log
0x02 SL R/O 5 Comprehensive SMART error log
0x03 GPL R/O 5 Ext. Comprehensive SMART error log
0x06 SL R/O 1 SMART self-test log
0x07 GPL R/O 1 Extended self-test log
0x09 SL R/W 1 Selective self-test log
0x10 GPL R/O 1 SATA NCQ Queued Error log
0x11 GPL R/O 1 SATA Phy Event Counters log
0x21 GPL R/O 1 Write stream error log
0x22 GPL R/O 1 Read stream error log
0x30 GPL,SL R/O 9 IDENTIFY DEVICE data log
0x80-0x9f GPL,SL R/W 16 Host vendor specific log
0xa1 GPL,SL VS 20 Device vendor specific log
0xa2 GPL VS 3900 Device vendor specific log
0xa8 GPL,SL VS 129 Device vendor specific log
0xa9 GPL,SL VS 1 Device vendor specific log
0xab GPL VS 1 Device vendor specific log
0xb0 GPL VS 4580 Device vendor specific log
0xbe-0xbf GPL VS 65535 Device vendor specific log
0xc0 GPL,SL VS 1 Device vendor specific log
0xc1 GPL,SL VS 10 Device vendor specific log
0xc4 GPL,SL VS 5 Device vendor specific log
0xe0 GPL,SL R/W 1 SCT Command/Status
0xe1 GPL,SL R/W 1 SCT Data Transfer
SMART Extended Comprehensive Error Log Version: 1 (5 sectors)
Device Error Count: 5
CR = Command Register
FEATR = Features Register
COUNT = Count (was: Sector Count) Register
LBA_48 = Upper bytes of LBA High/Mid/Low Registers ] ATA-8
LH = LBA High (was: Cylinder High) Register ] LBA
LM = LBA Mid (was: Cylinder Low) Register ] Register
LL = LBA Low (was: Sector Number) Register ]
DV = Device (was: Device/Head) Register
DC = Device Control Register
ER = Error register
ST = Status register
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.
Error 5 [4] occurred at disk power-on lifetime: 25014 hours (1042 days + 6 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER -- ST COUNT LBA_48 LH LM LL DV DC
-- -- -- == -- == == == -- -- -- -- --
40 -- 51 00 00 00 00 32 2e dc 00 00 00 Error: WP at LBA = 0x322edc00 = 841931776
Commands leading to the command that caused the error were:
CR FEATR COUNT LBA_48 LH LM LL DV DC Powered_Up_Time Command/Feature_Name
-- == -- == -- == == == -- -- -- -- -- --------------- --------------------
61 00 00 00 10 00 00 38 33 34 48 40 00 00:38:14.385 WRITE FPDMA QUEUED
61 00 00 00 08 00 00 33 b7 68 00 40 00 00:38:14.385 WRITE FPDMA QUEUED
60 00 00 00 08 00 00 32 2e dc 00 40 00 00:38:14.384 READ FPDMA QUEUED
60 00 00 00 80 00 00 32 2e f4 80 40 00 00:38:13.971 READ FPDMA QUEUED
61 00 00 00 01 00 00 74 70 6d ae 40 00 00:38:13.953 WRITE FPDMA QUEUED
Error 4 [3] occurred at disk power-on lifetime: 25014 hours (1042 days + 6 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER -- ST COUNT LBA_48 LH LM LL DV DC
-- -- -- == -- == == == -- -- -- -- --
40 -- 51 00 00 00 00 32 2e dc 00 00 00 Error: UNC at LBA = 0x322edc00 = 841931776
Commands leading to the command that caused the error were:
CR FEATR COUNT LBA_48 LH LM LL DV DC Powered_Up_Time Command/Feature_Name
-- == -- == -- == == == -- -- -- -- -- --------------- --------------------
60 00 00 00 80 00 00 32 2e f4 00 40 00 00:38:10.088 READ FPDMA QUEUED
60 00 00 01 00 00 00 32 2e f3 00 40 00 00:38:10.088 READ FPDMA QUEUED
60 00 00 03 80 00 00 32 2e ef 80 40 00 00:38:10.088 READ FPDMA QUEUED
60 00 00 00 80 00 00 32 2e ef 00 40 00 00:38:10.086 READ FPDMA QUEUED
60 00 00 01 00 00 00 32 2e ee 00 40 00 00:38:10.083 READ FPDMA QUEUED
Error 3 [2] occurred at disk power-on lifetime: 25013 hours (1042 days + 5 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER -- ST COUNT LBA_48 LH LM LL DV DC
-- -- -- == -- == == == -- -- -- -- --
40 -- 51 00 00 00 00 03 67 83 08 00 00 Error: UNC at LBA = 0x03678308 = 57115400
Commands leading to the command that caused the error were:
CR FEATR COUNT LBA_48 LH LM LL DV DC Powered_Up_Time Command/Feature_Name
-- == -- == -- == == == -- -- -- -- -- --------------- --------------------
60 00 00 00 80 00 00 03 67 86 00 40 00 00:03:55.854 READ FPDMA QUEUED
60 00 00 00 80 00 00 03 67 29 00 40 00 00:03:55.312 READ FPDMA QUEUED
60 00 00 05 00 00 00 03 67 24 00 40 00 00:03:55.308 READ FPDMA QUEUED
60 00 00 05 00 00 00 03 67 1f 00 40 00 00:03:55.305 READ FPDMA QUEUED
60 00 00 00 80 00 00 03 67 1e 80 40 00 00:03:55.303 READ FPDMA QUEUED
Error 2 [1] occurred at disk power-on lifetime: 25013 hours (1042 days + 5 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER -- ST COUNT LBA_48 LH LM LL DV DC
-- -- -- == -- == == == -- -- -- -- --
40 -- 51 00 00 00 00 03 66 c0 f8 00 00 Error: UNC at LBA = 0x0366c0f8 = 57065720
Commands leading to the command that caused the error were:
CR FEATR COUNT LBA_48 LH LM LL DV DC Powered_Up_Time Command/Feature_Name
-- == -- == -- == == == -- -- -- -- -- --------------- --------------------
60 00 00 00 08 00 00 03 66 c0 f8 40 00 00:03:51.277 READ FPDMA QUEUED
60 00 00 00 08 00 00 03 66 c0 f0 40 00 00:03:51.277 READ FPDMA QUEUED
60 00 00 00 08 00 00 03 66 c0 e8 40 00 00:03:51.277 READ FPDMA QUEUED
60 00 00 00 08 00 00 03 66 c0 e0 40 00 00:03:51.277 READ FPDMA QUEUED
60 00 00 00 08 00 00 03 66 c0 d8 40 00 00:03:51.276 READ FPDMA QUEUED
Error 1 [0] occurred at disk power-on lifetime: 25013 hours (1042 days + 5 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER -- ST COUNT LBA_48 LH LM LL DV DC
-- -- -- == -- == == == -- -- -- -- --
40 -- 51 00 00 00 00 03 66 c0 f8 00 00 Error: UNC at LBA = 0x0366c0f8 = 57065720
Commands leading to the command that caused the error were:
CR FEATR COUNT LBA_48 LH LM LL DV DC Powered_Up_Time Command/Feature_Name
-- == -- == -- == == == -- -- -- -- -- --------------- --------------------
60 00 00 05 00 00 00 03 66 c1 80 40 00 00:03:47.634 READ FPDMA QUEUED
60 00 00 05 00 00 00 03 66 83 80 40 00 00:03:46.958 READ FPDMA QUEUED
60 00 00 03 80 00 00 03 66 80 00 40 00 00:03:46.676 READ FPDMA QUEUED
60 00 00 02 00 00 00 03 66 7e 00 40 00 00:03:46.676 READ FPDMA QUEUED
60 00 00 03 80 00 00 03 45 80 80 40 00 00:03:41.111 READ FPDMA QUEUED
SMART Extended Self-test Log Version: 1 (1 sectors)
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 28190 -
# 2 Short offline Completed without error 00% 28154 -
# 3 Short offline Completed without error 00% 28150 -
# 4 Short offline Completed without error 00% 28127 -
# 5 Short offline Completed without error 00% 28121 -
# 6 Short offline Completed without error 00% 28088 -
# 7 Short offline Completed without error 00% 28056 -
# 8 Short offline Completed without error 00% 28053 -
# 9 Short offline Completed without error 00% 28050 -
#10 Short offline Completed without error 00% 28049 -
#11 Short offline Completed without error 00% 28047 -
#12 Short offline Completed without error 00% 28045 -
#13 Short offline Completed without error 00% 28044 -
#14 Short offline Completed without error 00% 28043 -
#15 Short offline Completed without error 00% 28042 -
#16 Short offline Completed without error 00% 28041 -
#17 Short offline Completed without error 00% 28040 -
#18 Short offline Completed without error 00% 28040 -
#19 Short offline Completed without error 00% 28039 -
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
SCT Status Version: 3
SCT Version (vendor specific): 522 (0x020a)
SCT Support Level: 1
Device State: Active (0)
Current Temperature: 40 Celsius
Power Cycle Min/Max Temperature: 23/40 Celsius
Lifetime Min/Max Temperature: 17/50 Celsius
Under/Over Temperature Limit Count: 0/0
SCT Data Table command not supported
SCT Error Recovery Control command not supported
Device Statistics (GP/SMART Log 0x04) not supported
SATA Phy Event Counters (GP Log 0x11)
ID Size Value Description
0x000a 2 3 Device-to-host register FISes sent due to a COMRESET
0x0001 2 0 Command failed due to ICRC error
0x0003 2 0 R_ERR response for device-to-host data FIS
0x0004 2 0 R_ERR response for host-to-device data FIS
0x0006 2 0 R_ERR response for device-to-host non-data FIS
0x0007 2 0 R_ERR response for host-to-device non-data FIS
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-76-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine immediately in off-line mode".
Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 1 minutes for test to complete.
Test will complete after Fri Feb 21 18:17:26 2020
Use smartctl -X to abort test.
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-76-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 28187 -
# 2 Short offline Completed without error 00% 28147 -
# 3 Short offline Completed without error 00% 28146 -
# 4 Short offline Completed without error 00% 28123 -
# 5 Short offline Completed without error 00% 28042 -
# 6 Short offline Completed without error 00% 28041 -
# 7 Short offline Completed without error 00% 28040 -
# 8 Short offline Completed without error 00% 28039 -
# 9 Short offline Completed without error 00% 28038 -
#10 Short offline Completed without error 00% 28037 -
#11 Short offline Completed without error 00% 28037 -
#12 Short offline Completed without error 00% 28036 -
#13 Short offline Completed without error 00% 28035 -
#14 Short offline Completed without error 00% 28034 -
#15 Short offline Completed without error 00% 28033 -
#16 Short offline Completed without error 00% 28032 -
#17 Short offline Completed without error 00% 28031 -
#18 Short offline Completed without error 00% 28020 -
#19 Short offline Completed without error 00% 28012 -
#20 Short offline Completed without error 00% 28002 -
#21 Short offline Completed without error 00% 27996 -
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-76-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-76-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Seagate Desktop SSHD
Device Model: ST1000DX001-1CM162
Serial Number: Z1DD26MH
LU WWN Device Id: 5 000c50 0792ce7ac
Firmware Version: CC43
User Capacity: 1000204886016 bytes [1,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-2, ACS-3 T13/2161-D revision 3b
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Fri Feb 21 18:19:26 2020 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
AAM feature is: Unavailable
APM level is: 254 (maximum performance)
Rd look-ahead is: Enabled
Write cache is: Enabled
ATA Security is: Disabled, NOT FROZEN [SEC1]
Wt Cache Reorder: Unavailable
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 575) seconds.
Offline data collection
capabilities: (0x7b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 106) minutes.
Conveyance self-test routine
recommended polling time: ( 2) minutes.
SCT capabilities: (0x1081) SCT Status supported.
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAGS VALUE WORST THRESH FAIL RAW_VALUE
1 Raw_Read_Error_Rate POSR-- 117 099 006 - 159427592
3 Spin_Up_Time PO---- 097 097 000 - 0
4 Start_Stop_Count -O--CK 099 099 020 - 1072
5 Reallocated_Sector_Ct PO--CK 100 100 010 - 56
7 Seek_Error_Rate POSR-- 083 060 030 - 204481223
9 Power_On_Hours -O--CK 068 068 000 - 28187
10 Spin_Retry_Count PO--C- 100 100 097 - 0
12 Power_Cycle_Count -O--CK 099 099 020 - 1125
183 Runtime_Bad_Block -O--CK 100 100 000 - 0
184 End-to-End_Error -O--CK 100 100 099 - 0
187 Reported_Uncorrect -O--CK 001 001 000 - 104
188 Command_Timeout -O--CK 100 099 000 - 0 0 8
189 High_Fly_Writes -O-RCK 098 098 000 - 2
190 Airflow_Temperature_Cel -O---K 065 050 045 - 35 (Min/Max 22/35)
191 G-Sense_Error_Rate -O--CK 100 100 000 - 0
192 Power-Off_Retract_Count -O--CK 100 100 000 - 51
193 Load_Cycle_Count -O--CK 099 099 000 - 2084
194 Temperature_Celsius -O---K 035 050 000 - 35 (0 17 0 0 0)
197 Current_Pending_Sector -O--C- 100 100 000 - 0
198 Offline_Uncorrectable ----C- 100 100 000 - 0
199 UDMA_CRC_Error_Count -OSRCK 200 200 000 - 0
240 Head_Flying_Hours ------ 100 253 000 - 28050h+50m+30.747s
241 Total_LBAs_Written ------ 100 253 000 - 50751688354
242 Total_LBAs_Read ------ 100 253 000 - 158059957814
||||||_ K auto-keep
|||||__ C event count
||||___ R error rate
|||____ S speed/performance
||_____ O updated online
|______ P prefailure warning
General Purpose Log Directory Version 1
SMART Log Directory Version 1 [multi-sector log support]
Address Access R/W Size Description
0x00 GPL,SL R/O 1 Log Directory
0x01 SL R/O 1 Summary SMART error log
0x02 SL R/O 5 Comprehensive SMART error log
0x03 GPL R/O 5 Ext. Comprehensive SMART error log
0x06 SL R/O 1 SMART self-test log
0x07 GPL R/O 1 Extended self-test log
0x09 SL R/W 1 Selective self-test log
0x10 GPL R/O 1 SATA NCQ Queued Error log
0x11 GPL R/O 1 SATA Phy Event Counters log
0x21 GPL R/O 1 Write stream error log
0x22 GPL R/O 1 Read stream error log
0x30 GPL,SL R/O 9 IDENTIFY DEVICE data log
0x80-0x9f GPL,SL R/W 16 Host vendor specific log
0xa1 GPL,SL VS 20 Device vendor specific log
0xa2 GPL VS 3900 Device vendor specific log
0xa8 GPL,SL VS 129 Device vendor specific log
0xa9 GPL,SL VS 1 Device vendor specific log
0xab GPL VS 1 Device vendor specific log
0xb0 GPL VS 4580 Device vendor specific log
0xbe-0xbf GPL VS 65535 Device vendor specific log
0xc0 GPL,SL VS 1 Device vendor specific log
0xc1 GPL,SL VS 10 Device vendor specific log
0xc4 GPL,SL VS 5 Device vendor specific log
0xe0 GPL,SL R/W 1 SCT Command/Status
0xe1 GPL,SL R/W 1 SCT Data Transfer
SMART Extended Comprehensive Error Log Version: 1 (5 sectors)
Device Error Count: 1
CR = Command Register
FEATR = Features Register
COUNT = Count (was: Sector Count) Register
LBA_48 = Upper bytes of LBA High/Mid/Low Registers ] ATA-8
LH = LBA High (was: Cylinder High) Register ] LBA
LM = LBA Mid (was: Cylinder Low) Register ] Register
LL = LBA Low (was: Sector Number) Register ]
DV = Device (was: Device/Head) Register
DC = Device Control Register
ER = Error register
ST = Status register
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.
Error 1 [0] occurred at disk power-on lifetime: 13660 hours (569 days + 4 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER -- ST COUNT LBA_48 LH LM LL DV DC
-- -- -- == -- == == == -- -- -- -- --
40 -- 51 00 00 00 00 09 5e f4 c8 00 00 Error: UNC at LBA = 0x095ef4c8 = 157217992
Commands leading to the command that caused the error were:
CR FEATR COUNT LBA_48 LH LM LL DV DC Powered_Up_Time Command/Feature_Name
-- == -- == -- == == == -- -- -- -- -- --------------- --------------------
60 00 00 0a 00 00 00 09 5e f7 80 40 00 5d+14:32:53.424 READ FPDMA QUEUED
60 00 00 05 80 00 00 09 5e f2 00 40 00 5d+14:32:53.424 READ FPDMA QUEUED
60 00 00 00 80 00 00 09 5e f1 80 40 00 5d+14:32:53.416 READ FPDMA QUEUED
61 00 00 01 a8 00 00 0a 72 de 28 40 00 5d+14:32:53.415 WRITE FPDMA QUEUED
61 00 00 00 08 00 00 33 b2 ef 90 40 00 5d+14:32:53.415 WRITE FPDMA QUEUED
SMART Extended Self-test Log Version: 1 (1 sectors)
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 28187 -
# 2 Short offline Completed without error 00% 28147 -
# 3 Short offline Completed without error 00% 28146 -
# 4 Short offline Completed without error 00% 28123 -
# 5 Short offline Completed without error 00% 28042 -
# 6 Short offline Completed without error 00% 28041 -
# 7 Short offline Completed without error 00% 28040 -
# 8 Short offline Completed without error 00% 28039 -
# 9 Short offline Completed without error 00% 28038 -
#10 Short offline Completed without error 00% 28037 -
#11 Short offline Completed without error 00% 28037 -
#12 Short offline Completed without error 00% 28036 -
#13 Short offline Completed without error 00% 28035 -
#14 Short offline Completed without error 00% 28034 -
#15 Short offline Completed without error 00% 28033 -
#16 Short offline Completed without error 00% 28032 -
#17 Short offline Completed without error 00% 28031 -
#18 Short offline Completed without error 00% 28020 -
#19 Short offline Completed without error 00% 28012 -
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
SCT Status Version: 3
SCT Version (vendor specific): 522 (0x020a)
SCT Support Level: 1
Device State: Active (0)
Current Temperature: 35 Celsius
Power Cycle Min/Max Temperature: 22/35 Celsius
Lifetime Min/Max Temperature: 17/47 Celsius
Under/Over Temperature Limit Count: 0/0
SCT Data Table command not supported
SCT Error Recovery Control command not supported
Device Statistics (GP/SMART Log 0x04) not supported
SATA Phy Event Counters (GP Log 0x11)
ID Size Value Description
0x000a 2 2 Device-to-host register FISes sent due to a COMRESET
0x0001 2 0 Command failed due to ICRC error
0x0003 2 0 R_ERR response for device-to-host data FIS
0x0004 2 0 R_ERR response for host-to-device data FIS
0x0006 2 0 R_ERR response for device-to-host non-data FIS
0x0007 2 0 R_ERR response for host-to-device non-data FIS
mia@mia-PC5:/etc/cron.daily$ sudo mail
[sudo] Mot de passe de mia :
Pas de courrier pour root
mia@mia-PC5:/etc/cron.daily$ mail
Pas de courrier pour mia
mia@mia-PC5:/etc/cron.daily$
Concernant le script que tu mets dans hourly, tu dis que c'est l'exécution du script qui envoie un mail.
En envoyant la commande bash smartctl, le script est exécuté, mais toujours pas de mail.
Il reste que le script n'est pas exécutable. Je m'y attèle demain et te tiens au courant.
J'ai bon espoir que ça fonctionne cette fois, merci
Hors ligne
#61 Le 21/02/2020, à 21:56
- grandtoubab
Re : Smartmontools n'envoie pas les mails
quand tu exécutes le script en commande avec bash c'est pour vérifier son exécution uniquement
il n'y a aucune raison d'avoir un mail puisque dans le code il n'y a pas de commande sendmail ou /usr/bin/mailx,etc
par contre lors de son exécution par anacron , anacron enverra un mail à root
Excuses moi je ne dois pas parler suffisament bien français pour me faire comprendre , ça ne fait que deux jours que je te répète la même chose
pour tester un envoi de mail en commande
echo "salut" | /usr/bin/mailx -s "Température du disque" root@localhost
de plus il manque une ligne dans ta anacrontab
0 40 cron.hourly run-parts --report /etc/cron.hourly
sinon hourly ne peut pas se lancer
Bon maintenant j'ai Koh-Lanta
Dernière modification par grandtoubab (Le 22/02/2020, à 13:21)
Linux tout seul sur HP Pavilion DV7 et Acer Aspire T650, Canon MG3650 en wifi
Debian 11 Bullseye Gnome/Xorg, Gnome/Wayland avec SDDM
https://bidouilledebian.wordpress.com/
ON M'A VU DANS LE VERCORS, SAUTER A L'ELASTIQUE..... J'AI DANS LES BOTTES DES MONTAGNES DE QUESTIONS....
Hors ligne
#62 Le 22/02/2020, à 14:12
- Mia98
Re : Smartmontools n'envoie pas les mails
Bonjour,
Il n'y a aucune raison d'avoir un mail puisque dans le code il n'y a pas de commande sendmail ou /usr/bin/mailx,etc
C'est bien ce que je me disais, surtout que dans ton script tempdisk je voyais deux lignes faisant référence à un envoi de mail :
/usr/bin/mailx -s "Le disque a fondu" root@localhost < /var/tmp/tempdisk
/usr/bin/mailx -s "Température du disque" root@localhost < /var/tmp/tempdis
Si j'ai bien compris, il n'est pas nécessaire de mettre ces lignes dans le script smartctl, il y a une liaison avec un fichier anacron qui se charge de l'envoi.
C'est pas évident à appréhender quand on est habitué à utiliser des interfaces graphiques...
Excuses moi je ne dois pas parler suffisament bien français pour me faire comprendre
Tu ne parles pas français, tu me parles bash
de plus il manque une ligne dans ta anacrontab
sinon hourly ne peut pas se lancer
Je l'avais passé en daily puisque le fichier 0anacron est manquant dans /etc/cron/hourly.
Je viens de le remettre dans hourly. En plus d'ajouter le fichier 0anacron manquant pour hourly, j'ai ajouté cette ligne dans anacrontab.
Le résultat est curieux, un rectangle rouge que je n'ai jamais rencontré auparavant dans un fichier, on dirait un avertissement d'erreur :
Je vais revenir à daily, ça me parait plus sûr, je ne sais pas au juste à quel heure le script sera lancé (je n'éteins pas, je passe en veille).
Hors ligne
#63 Le 22/02/2020, à 14:27
- grandtoubab
Re : Smartmontools n'envoie pas les mails
l'heure de passage c'est toi qui la détermine
0 40 hourly ça veut dire que le premier lancement aura lieu 40 mn après le demarrage , puis toutes les heures
il suffit de vérifier dans la journal
journalctl | grep cron
févr. 22 05:21:53 debian systemd[1]: Started Trigger anacron every hour.
févr. 22 05:21:53 debian systemd[1]: Started Run anacron jobs.
févr. 22 05:21:53 debian anacron[2197]: Anacron 2.3 started on 2020-02-22
févr. 22 05:21:53 debian cron[2201]: (CRON) INFO (pidfile fd = 3)
févr. 22 05:21:54 debian anacron[2197]: Will run job `cron.daily' in 20 min.
févr. 22 05:21:54 debian anacron[2197]: Will run job `cron.hourly' in 40 min.
févr. 22 05:21:54 debian anacron[2197]: Jobs will be executed sequentially
févr. 22 05:21:55 debian cron[2201]: (CRON) INFO (Running @reboot jobs)
févr. 22 05:41:54 debian anacron[2197]: Job `cron.daily' started
févr. 22 05:41:54 debian anacron[9681]: Updated timestamp for job `cron.daily' to 2020-02-22
févr. 22 05:45:59 debian anacron[2197]: Job `cron.daily' terminated (mailing output)
févr. 22 06:01:53 debian anacron[2197]: Job `cron.hourly' started
févr. 22 06:01:53 debian anacron[10468]: Updated timestamp for job `cron.hourly' to 2020-02-22
févr. 22 06:02:25 debian anacron[2197]: Job `cron.hourly' terminated
févr. 22 06:02:25 debian anacron[2197]: Normal exit (2 jobs run)
févr. 22 06:02:25 debian systemd[1]: anacron.service: Succeeded.
févr. 22 07:30:01 debian CRON[16828]: pam_unix(cron:session): session opened for user root by (uid=0)
févr. 22 07:30:01 debian CRON[16831]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi)
févr. 22 07:30:01 debian CRON[16828]: pam_unix(cron:session): session closed for user root
févr. 22 07:31:40 debian systemd[1]: Started Run anacron jobs.
févr. 22 07:31:40 debian anacron[16847]: Anacron 2.3 started on 2020-02-22
févr. 22 07:31:40 debian anacron[16847]: Will run job `cron.hourly' in 40 min.
févr. 22 07:31:40 debian anacron[16847]: Jobs will be executed sequentially
févr. 22 08:11:40 debian anacron[16847]: Job `cron.hourly' started
févr. 22 08:11:40 debian anacron[91207]: Updated timestamp for job `cron.hourly' to 2020-02-22
févr. 22 08:12:12 debian anacron[16847]: Job `cron.hourly' terminated
févr. 22 08:12:12 debian anacron[16847]: Normal exit (1 job run)
févr. 22 08:12:12 debian systemd[1]: anacron.service: Succeeded.
févr. 22 08:30:02 debian CRON[100004]: pam_unix(cron:session): session opened for user root by (uid=0)
févr. 22 08:30:02 debian CRON[100006]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi)
févr. 22 08:30:02 debian CRON[100004]: pam_unix(cron:session): session closed for user root
févr. 22 08:34:40 debian systemd[1]: Started Run anacron jobs.
févr. 22 08:34:40 debian anacron[100066]: Anacron 2.3 started on 2020-02-22
févr. 22 08:34:40 debian anacron[100066]: Will run job `cron.hourly' in 40 min.
févr. 22 08:34:40 debian anacron[100066]: Jobs will be executed sequentially
févr. 22 09:14:40 debian anacron[100066]: Job `cron.hourly' started
févr. 22 09:14:40 debian anacron[100658]: Updated timestamp for job `cron.hourly' to 2020-02-22
févr. 22 09:15:12 debian anacron[100066]: Job `cron.hourly' terminated
févr. 22 09:15:12 debian anacron[100066]: Normal exit (1 job run)
févr. 22 09:15:12 debian systemd[1]: anacron.service: Succeeded.
févr. 22 09:30:01 debian CRON[100836]: pam_unix(cron:session): session opened for user root by (uid=0)
févr. 22 09:30:01 debian CRON[100838]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi)
févr. 22 09:30:01 debian CRON[100836]: pam_unix(cron:session): session closed for user root
févr. 22 09:34:40 debian systemd[1]: Started Run anacron jobs.
févr. 22 09:34:40 debian anacron[100885]: Anacron 2.3 started on 2020-02-22
févr. 22 09:34:40 debian anacron[100885]: Will run job `cron.hourly' in 40 min.
févr. 22 09:34:40 debian anacron[100885]: Jobs will be executed sequentially
févr. 22 10:14:40 debian anacron[100885]: Job `cron.hourly' started
févr. 22 10:14:40 debian anacron[101664]: Updated timestamp for job `cron.hourly' to 2020-02-22
févr. 22 10:15:13 debian anacron[100885]: Job `cron.hourly' terminated
févr. 22 10:15:13 debian anacron[100885]: Normal exit (1 job run)
févr. 22 10:15:13 debian systemd[1]: anacron.service: Succeeded.
févr. 22 10:30:01 debian CRON[105527]: pam_unix(cron:session): session opened for user root by (uid=0)
févr. 22 10:30:01 debian CRON[105529]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi)
févr. 22 10:30:01 debian CRON[105527]: pam_unix(cron:session): session closed for user root
févr. 22 10:32:09 debian systemd[1]: Started Run anacron jobs.
févr. 22 10:32:09 debian anacron[105554]: Anacron 2.3 started on 2020-02-22
févr. 22 10:32:09 debian anacron[105554]: Will run job `cron.hourly' in 40 min.
févr. 22 10:32:09 debian anacron[105554]: Jobs will be executed sequentially
févr. 22 11:12:09 debian anacron[105554]: Job `cron.hourly' started
févr. 22 11:12:09 debian anacron[106079]: Updated timestamp for job `cron.hourly' to 2020-02-22
févr. 22 11:12:42 debian anacron[105554]: Job `cron.hourly' terminated
févr. 22 11:12:42 debian anacron[105554]: Normal exit (1 job run)
févr. 22 11:12:42 debian systemd[1]: anacron.service: Succeeded.
févr. 22 11:30:01 debian CRON[106414]: pam_unix(cron:session): session opened for user root by (uid=0)
févr. 22 11:30:01 debian CRON[106416]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi)
févr. 22 11:30:01 debian CRON[106414]: pam_unix(cron:session): session closed for user root
févr. 22 11:34:15 debian systemd[1]: Started Run anacron jobs.
févr. 22 11:34:15 debian anacron[106525]: Anacron 2.3 started on 2020-02-22
févr. 22 11:34:15 debian anacron[106525]: Will run job `cron.hourly' in 40 min.
févr. 22 11:34:15 debian anacron[106525]: Jobs will be executed sequentially
févr. 22 12:14:15 debian anacron[106525]: Job `cron.hourly' started
févr. 22 12:14:15 debian anacron[109105]: Updated timestamp for job `cron.hourly' to 2020-02-22
févr. 22 12:14:47 debian anacron[106525]: Job `cron.hourly' terminated
févr. 22 12:14:47 debian anacron[106525]: Normal exit (1 job run)
févr. 22 12:14:47 debian systemd[1]: anacron.service: Succeeded.
févr. 22 12:30:02 debian CRON[109611]: pam_unix(cron:session): session opened for user root by (uid=0)
févr. 22 12:30:02 debian CRON[109613]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi)
févr. 22 12:30:02 debian CRON[109611]: pam_unix(cron:session): session closed for user root
févr. 22 12:33:15 debian systemd[1]: Started Run anacron jobs.
févr. 22 12:33:15 debian anacron[109679]: Anacron 2.3 started on 2020-02-22
févr. 22 12:33:15 debian anacron[109679]: Will run job `cron.hourly' in 40 min.
févr. 22 12:33:15 debian anacron[109679]: Jobs will be executed sequentially
févr. 22 13:13:15 debian anacron[109679]: Job `cron.hourly' started
févr. 22 13:13:15 debian anacron[110131]: Updated timestamp for job `cron.hourly' to 2020-02-22
févr. 22 13:13:47 debian anacron[109679]: Job `cron.hourly' terminated
févr. 22 13:13:47 debian anacron[109679]: Normal exit (1 job run)
févr. 22 13:13:47 debian systemd[1]: anacron.service: Succeeded.
Bien evidemment pour prendre en compte une modification de anacrontab il faut redémarrer
tu l'as bien vu ce petit message
févr. 22 05:45:59 debian anacron[2197]: Job `cron.daily' terminated (mailing output)
cron signale qu'il a envoyé un mail
Ce mail etatnt celui concernant mon script ze-testl.....car il produit un résultat
/etc/cron.daily/ze-test-kernel-installed:
samedi 22 février 2020, 05:45:54 (UTC+0100)
*********************************************************************************************
linux-image-4.19.0-8-amd64/stable,now 4.19.98-1 amd64 [installé]
linux-image-5.4.0-4-amd64/testing,unstable,now 5.4.19-1 amd64 [installé, automatique]
linux-image-amd64/testing,unstable,now 5.4.19-1 amd64 [installé]
*********************************************************************************************
linux-headers-4.19.0-8-amd64/stable,now 4.19.98-1 amd64 [installé]
linux-headers-5.4.0-4-amd64/testing,unstable,now 5.4.19-1 amd64 [installé]
linux-headers-amd64/testing,unstable,now 5.4.19-1 amd64 [installé]
*********************************************************************************************
linux-headers-4.19.0-8-common/stable,stable,now 4.19.98-1 all [installé, automatique]
linux-headers-5.4.0-4-common/testing,testing,unstable,unstable,now 5.4.19-1 all [installé, automatique]
*********************************************************************************************
samedi 22 février 2020, 05:45:59 (UTC+0100)
par contre celui là
févr. 22 13:13:47 debian anacron[109679]: Job `cron.hourly' terminated
cron ne signale pas de mail mais comme j'en ai codé un dans le script, il y a quand meme un mail
ce mail est en français car je l'ai codé avec mes gros doigts
Sujet :
Température du disque
De :
root@debian
Date :
22/02/2020 à 13:13
Pour :
<root@localhost>
/dev/sda: Hitachi HTS725032A9A364: 40°C
capito??
Pour terminer l'histoire voici ou j'en suis evec smartd
DEVICESCAN -a -r 190! -R 190! -W 1,0,58 -n standby -m root@localhost -M test -M exec /etc/smartmontools/smartd_warning.d/10mail
j'ai codé ce script en m'inspirant de ce qui existe ailleurs dans smartd comme ça je maitrise le texte affiché
dans $tmp on trouve les infos données par smartd
usr/bin/mailx -s "S.M.A.R.T Alerte Disque" root@localhost < $tmp
ce qui donne
Sujet :
S.M.A.R.T Alerte Disque
De :
root@debian
Date :
22/02/2020 à 05:22
Pour :
<root@localhost>
This message was generated by the smartd daemon running on:
host name: debian
DNS domain: [Empty]
The following warning/error was logged by the smartd daemon:
TEST EMAIL from smartd for device: /dev/sda [SAT]
Device info:
Hitachi HTS725032A9A364, S/N:110305PCKC04BPJ0X3GK, WWN:5-000cca-645dc9889, FW:PC3OCH0A, 320 GB
For details see host's SYSLOG.
Et quand l'indicateur 190 fait des siennes
Sujet :
S.M.A.R.T Alerte Disque
De :
root@debian
Date :
21/02/2020 à 17:42
Pour :
<root@localhost>
This message was generated by the smartd daemon running on:
host name: debian
DNS domain: [Empty]
The following warning/error was logged by the smartd daemon:
Device: /dev/sda [SAT], SMART Usage Attribute: 190 Airflow_Temperature_Cel changed from 57 [Raw 43 (Min/Max 22/43)] to 58 [Raw 42 (Min/Max 22/44)]
Device info:
Hitachi HTS725032A9A364, S/N:110305PCKC04BPJ0X3GK, WWN:5-000cca-645dc9889, FW:PC3OCH0A, 320 GB
For details see host's SYSLOG.
You can also use the smartctl utility for further investigation.
The original message about this issue was sent at Wed Feb 19 16:48:16 2020 CET
Another message will be sent in 24 hours if the problem persists.
Mais comme indiqué smartd ne signale un indicateur qu'une seule fois par jour
Dernière modification par grandtoubab (Le 22/02/2020, à 14:58)
Linux tout seul sur HP Pavilion DV7 et Acer Aspire T650, Canon MG3650 en wifi
Debian 11 Bullseye Gnome/Xorg, Gnome/Wayland avec SDDM
https://bidouilledebian.wordpress.com/
ON M'A VU DANS LE VERCORS, SAUTER A L'ELASTIQUE..... J'AI DANS LES BOTTES DES MONTAGNES DE QUESTIONS....
Hors ligne
#64 Le 22/02/2020, à 21:43
- Mia98
Re : Smartmontools n'envoie pas les mails
Cette fois c'est clair, grâce à tes explications, je comprends mieux comment tout cela fonctionne, merci de t'être mis à ma portée
Je vais essayer de me familiariser avec les scripts et les lignes de commandes.
Encore merci pour ce que tu m'as appris.
Bonne soirée
Hors ligne
#65 Le 23/02/2020, à 08:46
- grandtoubab
Re : Smartmontools n'envoie pas les mails
voila le contenu du script pour smartd à mettre dans:
/etc/smartmontools/smartd_warning.d/10mail
#!/bin/bash -e
# Send mail if /usr/bin/mail exists
if ! [ -x /usr/bin/mail ]; then
echo "Your system does not have /usr/bin/mail. Install the mailx or mailutils package"
exit 1
fi
tmp=$(tempfile)
cat >$tmp
echo $(tempfile) > /home/toto/alerte-smart
cat $tmp >> /home/toto/alerte-smart
/usr/bin/mailx -s "S.M.A.R.T Alerte Disque" root@localhost < $tmp
rm -f $tmp
Tu remplaces simplement toto par le nom de ton utilisateur au sens unix.
Si tu veux envoyer à l'extérieur tu remplaces root@localhost par l'adresse email de ton choix
Dernière modification par grandtoubab (Le 23/02/2020, à 08:47)
Linux tout seul sur HP Pavilion DV7 et Acer Aspire T650, Canon MG3650 en wifi
Debian 11 Bullseye Gnome/Xorg, Gnome/Wayland avec SDDM
https://bidouilledebian.wordpress.com/
ON M'A VU DANS LE VERCORS, SAUTER A L'ELASTIQUE..... J'AI DANS LES BOTTES DES MONTAGNES DE QUESTIONS....
Hors ligne
#66 Le 23/02/2020, à 11:14
- Mia98
Re : Smartmontools n'envoie pas les mails
Trop bien, merci
J'ai reçu un mail ce matin pour le script smartctl dans cron.daily, ça roule de ce côté là aussi
Cette fois mes disques seront bien surveillés
@ +
Sur Toile Libre, choisir le lien « Insérer la miniature dans un forum : »
Dernière modification par cqfd93 (Le 23/02/2020, à 13:04)
Hors ligne