Browse Source

Add 'maintence.sh'

init
Thierry Reijnhout 3 years ago
parent
commit
6a7c1f138d
1 changed files with 34 additions and 0 deletions
  1. 34 0
      maintence.sh

+ 34 - 0
maintence.sh

@@ -0,0 +1,34 @@
+#!/bin/bash
+
+DATE=$2
+IP=$1
+logfile="/root/log/Disk_Status-$1-$DATE.log"
+tempFile="/tmp/smart-raid-zfs-$1_$DATE.log"
+
+echo "Do disk chek waiting for connection whit:$IP @ `date`______________________________________________________________________________________________________________________________"
+
+echo "-----------------------------------------------------------------------------------------------`date` chacke mdraid devices" >> $tempFile
+ssh root@$IP -tti /home/thierry/id_rsa 'cat /proc/mdstat' >> $tempFile
+
+echo "-----------------------------------------------------------------------------------------------`date` zfs pool" >> $tempFile
+ssh root@$IP -tti /home/thierry/id_rsa 'zpool status' >> $tempFile
+
+echo "-----------------------------------------------------------------------------------------------`date` Smart inportend Valus" >> $tempFile
+ssh root@$IP -tti /home/thierry/id_rsa 'echo " "; echo " "; echo " "; date;echo "--------------------------------------------------------------------------------------------------------------"; smartctl --all /dev/sda ;smartctl --all /dev/sdb ; smartctl --all /dev/sdc ; smartctl --all /dev/sdd ; smartctl --all /dev/sde; smartctl --all /dev/sdf ; smartctl --all -d sat /dev/sdg' >> $tempFile.tmp   ###smartd test on al disk manual setup
+
+echo "next valuas are in order of sda sdb sdc sdd sde and ordererd by error" >> $tempFile
+echo "ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE" >> $tempFile
+ grep -E 'Raw_Read_Error_Rate' $tempFile.tmp >> $tempFile
+ grep -E 'Reallocated_Sector_Ct' $tempFile.tmp >> $tempFile
+ grep -E 'Seek_Error_Rate' $tempFile.tmp >> $tempFile
+ grep -E 'Power_On_Hours' $tempFile.tmp >> $tempFile
+ grep -E 'Load_Cycle_Count' $tempFile.tmp >> $tempFile
+ grep -E 'Reallocated_Event_Count' $tempFile.tmp >> $tempFile
+ grep -E 'Media_Wearout_Indicator' $tempFile.tmp >> $tempFile
+
+scp -i /home/thierry/id_rsa $tempFile root@10.0.0.1:$logfile  #work around for remote machines? workaround dont touch!
+rm $tempFile
+echo "Done disk chek waiting for connection whit:$IP @ `date`______________________________________________________________________________________________________________________________"
+
+#use  hdparm -i /dev/sd[abcd] to indentify disk....serial number etc...
+