IPMI

From Omnia
Jump to navigation Jump to search

IPMI

Example servers with BMC (Base Management Controller) or IPMI (Intelligent Platform Management Interface) interface

  • Supermicro = IPMI
  • Dell = iDRAC
  • HP = iLO
  • Sun-Micro = ILOM
  • Cisco = CIME
  • Quanta = IPMI

See Also

See Supermicro/IPMI

See Linux/ipmitool

See Windows/ipmiutil

See Windows/ipmitool

ipmipower

# for ipmipower tool:
yum install freeipmi
apt-get install freeipmi-tools

/usr/local/sbin/pm:

#!/bin/bash

ACTION="unknown"
while getopts "r01" Option ; do
        case $Option in
                r)
                        ACTION="reboot"
                        ;;
                0)
                        ACTION="off"
                        ;;
                1)
                        ACTION="on"
                        ;;
                *)
                        echo "Error, unknown parameter: $Option"
                        exit 1
                        ;;
        esac
done
shift $(($OPTIND - 1))

if [ $# -ne 1 -o "$ACTION" == "unknown" ] ; then
        echo "Usage: $0 [-r:REBOOT][-0:OFF][-1:ON] <SERVER_IPMI>"
        exit 1
fi

SERVER=$1
echo "$SERVER" | grep "i-" > /dev/null
if [ $? -ne 0 ] ; then
        SERVER="i-$SERVER"
fi

if [ "$ACTION" == "reboot" ] ; then
        echo "Rebooting $SERVER..."
        ipmipower -h $SERVER -u ADMIN -p ADMIN -r
elif [ "$ACTION" == "on" ] ; then
        echo "Powering On $SERVER..."
        ipmipower -h $SERVER -u ADMIN -p ADMIN --on
elif [ "$ACTION" == "on" ] ; then
        echo "Powering Off $SERVER..."
        ipmipower -h $SERVER -u ADMIN -p ADMIN --off
fi