| 1 | #!/bin/bash
|
|---|
| 2 | #
|
|---|
| 3 | # This script captures the HP ProLiant BIOS,Smart Array RAID controllers
|
|---|
| 4 | # and iLO configurations and saves them to a USB Key labeled LiveUSB
|
|---|
| 5 | #
|
|---|
| 6 | # October 2011
|
|---|
| 7 | #
|
|---|
| 8 |
|
|---|
| 9 | clear
|
|---|
| 10 | echo "*** Capturing Configuration ***"
|
|---|
| 11 |
|
|---|
| 12 | [ -f /ssstk/ssstk-functions ] && . /ssstk/ssstk-functions
|
|---|
| 13 |
|
|---|
| 14 | # Load the drivers and mount the USB key where the settings will be saved
|
|---|
| 15 | ssstk_init
|
|---|
| 16 |
|
|---|
| 17 | # Capturing ProLiant BIOS configuration
|
|---|
| 18 | hp-conrep -s -f${BIOS_FILE} -x ${CONREP_XML} > /dev/null 2>&1
|
|---|
| 19 | if [ $? = 0 ] ; then
|
|---|
| 20 | echo "System Configuration saved to ${BIOS_FILE##/tmp/*/}"
|
|---|
| 21 | else
|
|---|
| 22 | echo "Failed to save configuration to ${BIOS_FILE##/tmp/*/}"
|
|---|
| 23 | fi
|
|---|
| 24 |
|
|---|
| 25 | # Check if a Smart Array controler is installed and capture its configuration
|
|---|
| 26 | # hp-ifhw is buggy with hp-scripting.*.rpm
|
|---|
| 27 | # hp-ifhw ${HWDISC_FILE} "$ALLBOARDS" "PCI:Smart Array" 2> /dev/null
|
|---|
| 28 | $IFHW_CMD ${HWDISC_FILE} "$ALLBOARDS" "PCI:Smart Array" 2> /dev/null
|
|---|
| 29 | if [ $? = 0 ] ; then
|
|---|
| 30 | hpacuscripting -c ${RAID_FILE}
|
|---|
| 31 | if [ $? = 0 ] ; then
|
|---|
| 32 | echo "Array Configuration saved to ${RAID_FILE##/tmp/*/}"
|
|---|
| 33 | else
|
|---|
| 34 | echo "Failed to save Array configuration to ${RAID_FILE##/tmp/*/}"
|
|---|
| 35 | fi
|
|---|
| 36 | else
|
|---|
| 37 | echo "No Smart Array detected, no ACU Configuration captured."
|
|---|
| 38 | fi
|
|---|
| 39 |
|
|---|
| 40 | # Check if an iLO interface is present and save its configuration
|
|---|
| 41 | $IFHW_CMD ${HWDISC_FILE} "$ALLBOARDS" "PCI:Integrated Lights-Out" 2> /dev/null
|
|---|
| 42 | if [ $? = 0 ] ; then
|
|---|
| 43 | modprobe hpilo
|
|---|
| 44 | hponcfg -a -w ${ILO_FILE}
|
|---|
| 45 | if [ $? = 0 ] ; then
|
|---|
| 46 | echo "Integrated Lights-Out Configuration Report saved to ${ILO_FILE##/tmp/*/}"
|
|---|
| 47 | echo " - this is not a RIBCL configuration script"
|
|---|
| 48 | else
|
|---|
| 49 | echo "Failed to save iLO configuration to ${ILO_FILE##/tmp/*/}"
|
|---|
| 50 | fi
|
|---|
| 51 | fi
|
|---|
| 52 |
|
|---|
| 53 | # Copy the log files if any and unmount the key
|
|---|
| 54 | ssstk_stop
|
|---|