
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
#!/bin/bash
# Ref - BFENG-1189 - script to collect ipmi mac and ipmi IP and alert if no ipmi ip found
#

_ipmi_data=$(ipmitool lan print | grep -A5 "IP Address*.*: 10")
_ipmi_ip=$(echo "${_ipmi_data}" | grep "IP Address" | awk '{print $NF}')
_ipmi_mac=$(echo "${_ipmi_data}" | grep "MAC Address" | awk '{print $NF}')

if [[ -n "${_ipmi_ip}" ]]; then
  echo "check_a2_ipmi_ip.sh.shared - ipmi mac ${_ipmi_mac} has ip: ${_ipmi_ip}"
  exit 0
elif [[ -z "${_ipmi_ip}" ]]; then
  echo "check_a2_ipmi_ip.sh.shared - ipmi interface ${_ipmi_mac} is missing IP"
  exit 2
fi
