#!
/bin/bash
# Define a separator function
print_separator() {
echo ""
echo "======================================================================"
}
# Define a function to execute a command and print the output
execute_command() {
local cmd="$1"
echo "--- Executing: $cmd ---"
# Execute the command
eval "$cmd"
# Print the return status (0 = success, non-zero = failure)
echo "--- Command finished with exit status: $? ---"
}
# ======================================================================
# Disk Validation
# ======================================================================
print_separator
echo " SECTION: Disk Validation"
print_separator
# 1. echo | format
execute_command "echo | format"
# NOTE: Check if there is any drive not available disk in the output.
print_separator
# 2. iostat -En | grep -i Hard
execute_command "iostat -En | grep -i Hard"
print_separator
# 3. zpool status -l
execute_command "zpool status -l"
print_separator
# 4. diskinfo
execute_command "diskinfo"
print_separator
# 5. iscsiadm list discovery-address -v
execute_command "iscsiadm list discovery-address -v"
# NOTE: Make sure all discovery IP addresses are reachable from cdom for redundancy
(requires manual check like 'ping' for each IP listed).
print_separator
# 6. luxadm -e port
execute_command "luxadm -e port"
print_separator
# 7. mpathadm list lu
execute_command "mpathadm list lu"
# NOTE: Check if the total path count is matching with the Operational path count
in the output.
print_separator
# ======================================================================
# Hardware Validation
# ======================================================================
print_separator
echo " SECTION: Hardware Validation"
print_separator
# 8. prtdiag -v
execute_command "prtdiag -v"
print_separator
# 9. fmadm faulty
execute_command "fmadm faulty"
print_separator
# 10. dmesg | egrep -i error
execute_command "dmesg | egrep -i error"
print_separator
# 11. ldm ls-io
execute_command "ldm ls-io"
# NOTE: If you find any empty or Unknown PCI card, please list it out after
reviewing the output.
print_separator
# 12. cfgadm -alv
execute_command "cfgadm -alv"
print_separator
# ======================================================================
# Network Checks
# ======================================================================
print_separator
echo " SECTION: Network Checks"
print_separator
# 13. ifconfig -a | grep -i failed
execute_command "ifconfig -a | grep -i failed"
print_separator
# 14. dladm show-link
execute_command "dladm show-link"
print_separator
# 15. dladm show-phys -P
execute_command "dladm show-phys -P"
print_separator
# 16. dladm show-aggr -x
execute_command "dladm show-aggr -x"
print_separator
# 17. dladm show-phys -L
execute_command "dladm show-phys -L"
# NOTE: This command typically shows link layer information. The note "Make sure
all discovery ip should be reachable from cdom for redundancy" seems misplaced here
and likely belongs with the 'iscsiadm' check, but if this output contains IPs,
check them.
print_separator
# 18. dladm show-phys -Z
execute_command "dladm show-phys -Z"
print_separator
echo " *** Script Execution Complete ***"
print_separator