summaryrefslogtreecommitdiff
path: root/templates/show/raid
diff options
context:
space:
mode:
Diffstat (limited to 'templates/show/raid')
-rw-r--r--templates/show/raid/node.def2
-rw-r--r--templates/show/raid/node.tag/node.def16
2 files changed, 18 insertions, 0 deletions
diff --git a/templates/show/raid/node.def b/templates/show/raid/node.def
new file mode 100644
index 0000000..d0ec96d
--- /dev/null
+++ b/templates/show/raid/node.def
@@ -0,0 +1,2 @@
+help: Show status of RAID set
+
diff --git a/templates/show/raid/node.tag/node.def b/templates/show/raid/node.tag/node.def
new file mode 100644
index 0000000..bc83a73
--- /dev/null
+++ b/templates/show/raid/node.tag/node.def
@@ -0,0 +1,16 @@
+help: RAID set name
+
+allowed:
+ local -a raid_sets ;
+ raid_sets=`cat /proc/partitions | grep md | awk '{ print $4 }'`
+ echo -n $raid_sets
+
+run:
+ raid_set_name=$3
+ raid_sets=`cat /proc/partitions | grep md | awk '{ print $4 }'`
+ valid_set=`echo $raid_sets | grep $raid_set_name`
+ if [ -z $valid_set ]; then
+ echo "$raid_set_name is not a RAID set"
+ else
+ mdadm --detail /dev/${raid_set_name}
+ fi \ No newline at end of file