ROOTPLOIT
Server: Apache
System: Linux node6122.myfcloud.com 6.14.3-x86_64-linode168 #1 SMP PREEMPT_DYNAMIC Mon Apr 21 19:47:55 EDT 2025 x86_64
User: bashacomputer (1004)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib64/nagios/plugins/check_a2_ipmi_ip.sh.shared
#!/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