I'm trying to use IPMITOOL to query a bunch of OOB NICs to get their MAC addresses.
When I run:
ipmitool -I lanplus -H 1.2.3.4 -U USER -P PASS lan print
I get:
MAC Address : aa:bb:cc:dd:ee:ff
If I try to call it via a shell script that iterates over a CSV file:
#!/bin/bash
INPUT=/home/user/list_of_systems.csv
OLDIFS=$IFS
IFS=','
while read hostname ipaddr
do
printf "$hostname\t" >> output.txt
ipmitool -I lanplus -H $ipaddr -U USER -P PASS lan print
done < $INPUT
IFS=$OLDIFS
I get:
failed lookup for 1.2.3.4
Could not open socket!
Error: Unable to establish IPMI v2 / RMCP+ session
What am I missing here? I have been tearing my hair out over this.