Various handy commands for interacting with a PowerEdge C BMC

bmc -H 10.1.1.64 -U jonas -P jonas allinfo
bmc -H 10.1.1.64 -U jonas -P jonas pecagent_health
bmc -H 10.1.1.64 -U jonas -P jonas bmc_hostname
bmc -H 10.1.1.64 -U jonas -P jonas bmc_hostname get
bmc -H 10.1.1.64 -U jonas -P jonas psus_required
bmc -H 10.1.1.64 -U jonas -P jonas psus_redundant
bmc -H 10.1.1.64 -U jonas -P jonas psus_seen
bmc -H 10.1.1.64 -U jonas -P jonas power_draw_node
bmc -H 10.1.1.64 -U jonas -P jonas power_draw_chassis
bmc -H 10.1.1.62 -U jonas -P jonas platform

SOL / Serial Over Lan connection from Linux to Dell iDRAC or BMC

Enable SOL with Racadm (or via the web interface – whichever):
racadm -r 10.2.2.2 -u root -p calvin config -g cfgIpmiLan -o cfgIpmiLanEnable 1

NOTE: for the ipmitool commands, create a new user with SOL permission first if root/root or root/calvin doesn’t work. This seems to be the case with the C series servers.

Connect using ipmitool:
jonas@erebus:~$ ipmitool -I lanplus -U jonas -P jonas -H 10.2.2.2 sol activate
jonas@erebus:~$

Terminate session:
▒~. [terminated ipmitool] (yes, termninate with “~.”)
jonas@erebus:~$

Identify and close iDRAC sessions via SSH

An iDRAC can run out of available sessions and hence refuse any new connections over the web interface. This happens if the admin logs on multiple times and doesn’t log out (just closing the window). Luckily this is easy to remedy:

SSH to iDRAC of server:
ssh root@10.6.26.222

Get session list:
racadm getssninfo
SSNID Type User IP Address Login Date/Time
—————————————————————————
6 GUI root 10.3.2.147 12/06/2013 09:34:49
7 GUI root 10.3.2.147 12/06/2013 09:35:25
11 GUI root 10.3.2.147 12/06/2013 10:43:57
12 SSH root 10.3.2.155 12/16/2013 12:46:31

Kill the session we want to get rid of:
racadm closessn -i 6
Session 6 closed successfully.

IPMI command use for PowerEdge C-series

NOTE: root/root works for web gui, but not for ipmi it seems.
Had to create a new user (with SOL privliges) to use ipmitool

Power control:
ipmitool -H 10.1.1.62 -U jonas -P jonas chassis power on
ipmitool -H 10.1.1.62 -U jonas -P jonas chassis power off
ipmitool -H 10.1.1.62 -U jonas -P jonas chassis power reset
ipmitool -H 10.1.1.62 -U jonas -P jonas chassis power soft

ID light for 3 seconds:
ipmitool -H 10.1.1.62 -U jonas -P jonas chassis identify 3

Show event log:
ipmitool -H 10.1.1.62 -U jonas -P jonas sel list

Show sensors A:
ipmitool -H 10.1.1.62 -U jonas -P jonas sdr list

Show sensors B:
ipmitool -H 10.1.1.62 -U jonas -P jonas sensor

Get single sensor record / status (pick one from the list displayed by the full sensor commands):
ipmitool -H 10.1.1.62 -U jonas -P jonas sensor get FAN_1

Use RAW commands to get hostname:
ipmitool -H 10.1.1.62 -U jonas -P jonas raw 0x06 0x59 0x00 0xd1 0x00 0x00
11 00 00 0e 50 6f 77 65 72 45 64 67 65 20 43 36 32 32

Convert the resulting hex to readable format from the python commandline
jonas@erebus:~$ python
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> “506f77657245646765204336”.decode(“hex”)
‘PowerEdge C6’  <——– This is our hostname 🙂
>>>

Power control and capping on Dell servers using RACADM

RACADM:
Usage: SSH -> racadm ->
Get current value: getconfig -g <group> -o <object>
Set a value: config -g <group> -o <object> <new_value>
Do “help” to get list of groups.
Do “help <groupname>” to get objects for a particular group.

Get current draw:
racadm getconfig -g cfgServerPower -o cfgServerActualPowerConsumption
108 W | 369 Btu/hr

Enable power capping:
racadm config -g cfgServerPower -o cfgServerPowerCapEnable 1
Object value modified successfully

Set cap:
racadm config -g cfgServerPower -o cfgServerPowerCapWatts 400
Object value modified successfully

Verify:
racadm getconfig -g cfgServerPower -o cfgServerPowerCapWatts
400 W

Get total kVh:
racadm getconfig -g cfgServerPower -o cfgServerCumulativePowerConsumption
292.370 KWh | 997859 Btu