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

Instant web server with Python!

Have you ever wanted to copy something from one machine to another without having to setup FTP, NFS, Samba etc? Luckily Python offers to help by creating an instant web server in the directory it’s launched from:

Listening on port 8000 (default):
python -m SimpleHTTPServer

Listening on port 8080:
python -m SimpleHTTPServer 8080

Then just use wget from the other machine to download the file(s) you want. Magic!

Record video in Linux with avconv and ffmpeg

Record screen in Linux with avconv (replacement for ffmpeg in Ubuntu):
avconv -f alsa -i pulse -f x11grab -r 25 -s 1920×1080 -i :0.0+0,0 -vcodec libx264 -pre:0 lossless_ultrafast -threads 0 video.mkv

Compress video and make ready for YouTube:
avconv -i video.mkv -c:v libx264 outputfile.mp4

Record screen in Linux with ffmpeg:
jonas@erebus:~$ ffmpeg -f x11grab -r 15 -s 1280*800 -i :0.0 -vcodec libx264 -vpre lossless_ultrafast -threads 4 -y -sameq out.mkv

Compress video and make ready for YouTube:
ffmpeg -i video.mkv -vcodec libx264 -vpre hq -crf 22 -threads 0 video.mp4