Shell-script - Check hardware error hpacucli hpasmcli, Shell script using hpacucli and hpasmcli

Check hardware error hpacucli hpasmcli

How to check hp hardware failure? How to test the hardware is failed or its working?
First create a fille called check-hardware-error, after creating the file, copy the below script in to the file and again create one more file called diskwitherror. This script helps you to find the hardware errors in the server. hardware error checker is a simple script which is written using switch case, which will help you to find the hardware error of a server.

check-hardware-error
#!/bin/bash
# http://w3calculator.com
# A simple shell script for HP Array Controller Utility

echo "Enter the server name"
read data
echo  "**********************************************"
echo  "Please select the options from below"
echo  "1. Enter servername"
echo  "2. Disk check"
echo  "3. Disk check with Failed Serial Number"
echo  "4. Battery of smart array"
echo  "5. Powersupply"
echo  "6. DIMM"
echo  "7. FAN"
echo  "8. Exit "
echo  "**********************************************"
echo "Select a option from above list"
read list
while [ $list -lt 8 ]; do

case "$list" in
 1)
   echo "Enter the server name"
   read data
   ;;
 2)
   echo "-----Disk Check------------------------"
   ssh root@$data "hpacucli controller all show config"
   ;;
 3)
   echo "----Disk check with Failed Serial Number--"
   scp diskwitherror root@$data:/tmp
   ssh root@$data "/tmp/diskwitherror"
   ;;
 4)
   ssh root@$data "hpacucli controller all show status"
   ;;
 5)
   ssh root@$data 'hpasmcli -s "show powersupply"'
   ;;
 6)
   ssh root@$data 'hpasmcli -s "show DIMM"'
   ;;
 7)
   ssh root@$data 'hpasmcli -s "show FAN"'
   ;;
 8)
   exit 1
   ;;
esac
echo  "**************************************"
echo  "Please select the options from below"
echo  "1. Enter servername"
echo  "2. Disk check"
echo  "3. Disk check with error report"
echo  "4. Battery of smart array"
echo  "5. Powersupply"
echo  "6. DIMM"
echo  "7. FAN"
echo  "8. Exit "
echo  "**************************************"
echo "Select a option from above list"
read list
done

Create a file diskwitherror
#!/bin/bash
# Script to check the failed disk with Serial number
pd=`hpacucli controller all show config | awk '$10 ~ "Fail" || $11 ~ "Fail" { print $2}'`
i=0
while [ $i -le 3 ]
do
hpacucli controller slot=$i pd $pd show
i=$(($i+1))
done

The topic on Shell-script - Check hardware error hpacucli hpasmcli is posted by - Math

Hope you have enjoyed, Shell-script - Check hardware error hpacucli hpasmcliThanks for your time

Tech Bluff