2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-31 10:06:39 +00:00

Merge pull request #4159 from samveen/fix_discovery

dodiscovery: get lan channel, dont use `1` (eg. `HP` uses `2`)
This commit is contained in:
zet809 2017-10-30 13:57:43 +08:00 committed by GitHub
commit 46358c576a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,15 +167,16 @@ if [ "$PLATFORM" != "unknown" ]; then
echo "<platform>$PLATFORM</platform>" >> /tmp/discopacket
fi
IsStatic=`ipmitool lan print 1 | grep 'IP Address Source' | grep 'Static'`
LANCHAN=$(ipmitool sol info |awk '/Payload Channel/{print $4}')
IsStatic=`ipmitool lan print $LANCHAN | grep 'IP Address Source' | grep 'Static'`
if [ "$IsStatic" ]; then
BMCIPADDR=`ipmitool lan print 1 | grep 'IP Address' | grep -v 'IP Address Source' | cut -d ":" -f2 | sed 's/ //'`
BMCIPADDR=`ipmitool lan print $LANCHAN | grep 'IP Address' | grep -v 'IP Address Source' | cut -d ":" -f2 | sed 's/ //'`
if [ "$BMCIPADDR" ]; then
echo "<bmc>$BMCIPADDR</bmc>" >> /tmp/discopacket
fi
fi
BMCMAC=`ipmitool lan print 1 | grep 'MAC Address' | cut -d ":" -f2-7 | sed 's/ //'`
BMCMAC=`ipmitool lan print $LANCHAN | grep 'MAC Address' | cut -d ":" -f2-7 | sed 's/ //'`
if [ "$BMCMAC" ]; then
echo "<bmcmac>$BMCMAC</bmcmac>" >> /tmp/discopacket
fi