]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - examplescripts/Example6
import smartmontools 7.0
[mirror_smartmontools-debian.git] / examplescripts / Example6
index b789c722ce0b6f3bf9f0f0cd103c4334478f62a0..73f304b0e2a57618f447b41d75a3e7c4883fa983 100755 (executable)
@@ -1,10 +1,28 @@
 #! /bin/sh
 
 # Send mail
-echo "$SMARTD_MESSAGE" | mail -s "$SMARTD_FAILTYPE" "$SMARTD_ADDRESS"
+if which mail >/dev/null 2>&1
+then
+  echo "$SMARTD_MESSAGE" | mail -s "$SMARTD_FAILTYPE" "$SMARTD_ADDRESS"
+fi
 
 # Notify desktop user
-MESSAGE="WARNING: Your hard drive is failing"
+MESSAGE="SMART Disk monitor:"
+case "$SMARTD_FAILTYPE" in
+    "EmailTest"|"Health"|"Temperature"|"Usage")
+        ;;
+    *)
+#       "CurrentPendingSector",       // 10
+#       "OfflineUncorrectableSector", // 11
+#       "FailedReadSmartErrorLog",    // 7
+#       "ErrorCount",                 // 4
+#       "FailedReadSmartData",        // 6
+#       "FailedHealthCheck",          // 5
+#       "FailedOpenDevice",           // 9
+#       "SelfTest",                   // 3
+#       "FailedReadSmartSelfTestLog", // 8
+      exit 0
+esac
 
 # direct write to terminals, do not use 'wall', because we don't want its ugly header
 for t in $(who | awk '{ print $2; }' | grep -e '^tty' -e '^pts/')