Skip to content

Commit

Permalink
Add information about wrong IP or credentials.
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian authored and tigerblue77 committed Dec 29, 2024
1 parent 56d1bf6 commit fa62b41
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ function graceful_exit() {
function get_Dell_server_model() {
IPMI_FRU_content=$(ipmitool -I $IDRAC_LOGIN_STRING fru 2>/dev/null) # FRU stands for "Field Replaceable Unit"

if [ $? -ne 0 ]; then
echo "Failed to retrieve iDRAC data, please check IP and credentials." >&2
return
fi

SERVER_MANUFACTURER=$(echo "$IPMI_FRU_content" | grep "Product Manufacturer" | awk -F ': ' '{print $2}')
SERVER_MODEL=$(echo "$IPMI_FRU_content" | grep "Product Name" | awk -F ': ' '{print $2}')

Expand Down

0 comments on commit fa62b41

Please sign in to comment.