smart script is not ganeti specific
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 14 Jan 2018 12:28:42 +0000 (13:28 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 14 Jan 2018 12:29:11 +0000 (13:29 +0100)
gnt-smart-megaraid.sh [deleted file]
smart-megaraid.sh [new file with mode: 0755]

diff --git a/gnt-smart-megaraid.sh b/gnt-smart-megaraid.sh
deleted file mode 100755 (executable)
index 449a24b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-pattern='^# 1'
-test ! -z "$1" && pattern=$1
-
-megaraid() {
-       drive=$1
-       nr=0
-       while [ $nr -lt 8 ] ; do
-               smartctl -d megaraid,$nr -a /dev/$drive > /dev/shm/smart.$drive.$nr
-               nr=`expr $nr + 1`
-       done
-}
-
-test -r /proc/mdstat && cat /proc/mdstat
-
-lsblk --noheadings --scsi -o name | while read drive ; do
-       smartctl -a /dev/$drive > /dev/shm/smart.$drive
-       if ! grep -q '^# 1' /dev/shm/smart.$drive ; then
-               megaraid $drive
-       fi
-done
-
-grep "$pattern" /dev/shm/smart.* | cut -d. -f2- | sed -e 's/:/\t/'
-
-
diff --git a/smart-megaraid.sh b/smart-megaraid.sh
new file mode 100755 (executable)
index 0000000..449a24b
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+pattern='^# 1'
+test ! -z "$1" && pattern=$1
+
+megaraid() {
+       drive=$1
+       nr=0
+       while [ $nr -lt 8 ] ; do
+               smartctl -d megaraid,$nr -a /dev/$drive > /dev/shm/smart.$drive.$nr
+               nr=`expr $nr + 1`
+       done
+}
+
+test -r /proc/mdstat && cat /proc/mdstat
+
+lsblk --noheadings --scsi -o name | while read drive ; do
+       smartctl -a /dev/$drive > /dev/shm/smart.$drive
+       if ! grep -q '^# 1' /dev/shm/smart.$drive ; then
+               megaraid $drive
+       fi
+done
+
+grep "$pattern" /dev/shm/smart.* | cut -d. -f2- | sed -e 's/:/\t/'
+
+