From 6a2940dc009e0016ac95a837c4080576f835df58 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 13 Oct 2007 17:14:54 +0200 Subject: [PATCH] contrib/exec-smartctl: Added a sample exec script which parses the hdd temperature using smartctl. --- contrib/exec-smartctl | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 contrib/exec-smartctl diff --git a/contrib/exec-smartctl b/contrib/exec-smartctl new file mode 100755 index 00000000..a5d8b134 --- /dev/null +++ b/contrib/exec-smartctl @@ -0,0 +1,29 @@ +#!/bin/bash + +INTERVAL=60 + +while true +do + TEMP=$((sudo smartctl -d 3ware,0 -A /dev/twe0 | grep Temperature_Celsius | awk '{ print $10; }') 2>/dev/null); + if [ $? -ne 0 ] + then + TEMP="U" + fi + echo "huhu/exec-smart/temperature-3ware_0 interval=$INTERVAL N:$TEMP" + + TEMP=$((sudo smartctl -d 3ware,1 -A /dev/twe0 | grep Temperature_Celsius | awk '{ print $10; }') 2>/dev/null); + if [ $? -ne 0 ] + then + TEMP="U" + fi + echo "huhu/exec-smart/temperature-3ware_1 interval=$INTERVAL N:$TEMP" + + TEMP=$((sudo smartctl -d ata -A /dev/sda | grep Temperature_Celsius | awk '{ print $10; }') 2>/dev/null); + if [ $? -ne 0 ] + then + TEMP="U" + fi + echo "huhu/exec-smart/temperature-sata_0 interval=$INTERVAL N:$TEMP" + + sleep $INTERVAL +done -- 2.11.0