3 # Print SCSI Enclosure Services (SES) info. The output is dependent on the name
4 # of the script/symlink used to call it.
7 enc: Show disk enclosure w:x:y:z value.
8 slot: Show disk slot number as reported by the enclosure.
9 encdev: Show /dev/sg* device associated with the enclosure disk slot.
10 fault_led: Show value of the disk enclosure slot fault LED.
11 locate_led: Show value of the disk enclosure slot locate LED.
12 ses: Show disk's enc, enc device, slot, and fault/locate LED values."
14 script=$(basename "$0")
15 if [ "$1" = "-h" ] ; then
16 echo "$helpstr" | grep "$script:" | tr -s '\t' | cut -f 2-
20 if [ "$script" = "ses" ] ; then
21 scripts='enc encdev slot fault_led locate_led'
26 for i in $scripts ; do
27 if [ -z "$VDEV_ENC_SYSFS_PATH" ] ; then
35 val=$(ls "$VDEV_ENC_SYSFS_PATH/../../" 2>/dev/null)
38 val=$(cat "$VDEV_ENC_SYSFS_PATH/slot" 2>/dev/null)
41 val=$(ls "$VDEV_ENC_SYSFS_PATH/../device/scsi_generic" 2>/dev/null)
44 val=$(cat "$VDEV_ENC_SYSFS_PATH/fault" 2>/dev/null)
47 val=$(cat "$VDEV_ENC_SYSFS_PATH/locate" 2>/dev/null)