Command-line HP Microserver DRAC Howto

I was trying to avoid having to use the web based gui to control my microservers with rac cards.

After asking google if I could it appeared the answer was no - it seemed that the access card was generating one time auth data and people assumed that it therefore wouldn't work.

When you try and request console access for the gui it returns a jnlp file. It occured to me that although the auth data appeared random I already had an admin account on the box, so I tried those details and it seemed to work fine.

I changed the file to make a template since I have a few microservers with rac cards - it now looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp codebase="https://R_HOSTNAME:443/" spec="1.0+">
  <title>Virtual KVM Client</title>
  <vendor>Hewlett-Packard Corporation</vendor>
   <icon href="http://R_HOSTNAME:80/images/logo.gif" kind="splash"/>
   <shortcut online="true"/>
 <application-desc main-class="com.avocent.kvm.client.Main">
   <argument>title=Virtual Console Session - R_HOSTNAME</argument>
   <j2se version="1.6 1.5 1.4+"/>
   <jar href="http://R_HOSTNAME:80/software/avctKVM.jar" download="eager" main="true" />
 <resources os="Windows">
   <nativelib href="http://R_HOSTNAME:80/software/avctKVMIOWin32.jar" download="eager"/>
  <resources os="Linux">
    <nativelib href="http://R_HOSTNAME:80/software/avctKVMIOLinux.jar" download="eager"/>

A little bit of sed later and I can call the console with javaws <fixed_file>.jnlp

Here's an example shell function to do this

openrac () {
  read -e -s -p "Password: " PASS
  echo -ne "\r         \r"
  cd ~
  sed -e "s#R_PASSWORD#$PASS#" -e "s#R_HOSTNAME#${1}${DOMAIN}#" \
    ~/Dropbox/Public/drac/rac-${2}.txt >.rac.jnlp
  javaws .rac.jnlp
  rm .rac.jnlp
  cd - >/dev/null

You can do exactly the same thing with the remote usb media jnlp file too.

This combined with ipmitool for power/sensor operations saves me ever having to log into the web interface.

An example script & jnlp files are available on github

Date: 2013-01-24 Thu

Emacs 24.5.1 (Org mode 8.2.10)