diff options
Diffstat (limited to 'templates/show')
-rw-r--r-- | templates/show/disk/node.def | 1 | ||||
-rw-r--r-- | templates/show/disk/node.tag/format/node.def | 12 | ||||
-rw-r--r-- | templates/show/disk/node.tag/node.def | 7 | ||||
-rw-r--r-- | templates/show/raid/node.def | 2 | ||||
-rw-r--r-- | templates/show/raid/node.tag/node.def | 16 |
5 files changed, 38 insertions, 0 deletions
diff --git a/templates/show/disk/node.def b/templates/show/disk/node.def new file mode 100644 index 0000000..8572a9f --- /dev/null +++ b/templates/show/disk/node.def @@ -0,0 +1 @@ +help: Show status of disk device diff --git a/templates/show/disk/node.tag/format/node.def b/templates/show/disk/node.tag/format/node.def new file mode 100644 index 0000000..e05b4ad --- /dev/null +++ b/templates/show/disk/node.tag/format/node.def @@ -0,0 +1,12 @@ +help: Show disk drive formatting + +run: + disk_dev=$3 + valid_disks=`cat /proc/partitions | awk '{ if ($4!="name") { print $4 } }' | egrep -v "[0-9]"` + is_a_disk=`echo $valid_disks | grep $disk_dev` + + if [ -z "$is_a_disk" ]; then + echo "$disk_dev is not a disk device" + else + fdisk -l /dev/${disk_dev} + fi diff --git a/templates/show/disk/node.tag/node.def b/templates/show/disk/node.tag/node.def new file mode 100644 index 0000000..7e4fe05 --- /dev/null +++ b/templates/show/disk/node.tag/node.def @@ -0,0 +1,7 @@ +help: Disk device name + +allowed: + local -a array ; + array=`cat /proc/partitions | awk '{ if ($4!="name") { print $4 } }' | egrep -v "[0-9]"` + echo -n $array + 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 |