A simple but powerful script for dell drac console.

In our organization we are using dell servers. Age of the servers vary from pretty much drac6 to idrac9.

Normally to access the remote console of the server you have to log on idrac web gui and from there you can launch the remote console. This all sounds pretty nice but over past few years, for me this has been a real hell on wheels. Usually what I find is the web gui for dell is extremely laggy, sometimes it doesn’t even load at all. Also when it comes to launch the actual jnlp file to get the process of loading up the console I’m getting various kinds of nasty java errors, mainly about security. The actual kvm is listening on port 5900 and no matter how i tried I couldn’t find a native binary client that would just simply connect to that port without any java hassle. Recently i came up with a partial solution to this problem. It is possible to launch the kvm jar file from command line, and it skip the entire web gui, and as the jar file is being called without using the jnlp it also steps over most of the java security madness. My script by default is also using a socks (dynamic ssh) proxy on port 8080. This helps to get through firewalls if your drac is not directly accessible. you just need to ssh to your gateway host first in a different shell using a -D8080 flag to open a socks proxy.

ihorvath@DBF3GQC2:~$ cat ./drac_all.sh
#!/bin/bash

echo -n 'Host: '
read drachost

echo -n 'Username: '
read dracuser

echo -n 'Password: '
read -s dracpwd
echo

# if you are lucky enough to use the same drac versions everywhere you can comment out the next line if you whish once you've initially downloaded the kvm jar file.
curl -k --preproxy socks5://127.0.0.1:8080  https://$drachost:443/software/avctKVM.jar -o kvm.jar

# path to java. change that accordingly.
/cygdrive/c/Program\ Files/Java/jre1.8.0_161/bin/java -cp kvm.jar -DsocksProxyHost=127.0.0.1 -DsocksProxyPort=8080 -Djava.library.path=./lib com.avocent.idrac.kvm.Main ip=$drachost kmport=5900 vport=5900 user=$dracuser passwd=$dracpwd apcp=1 reconnect=2 chat=1 F1=1 version=2 custom=0 scaling=15 vm=1 title=Istys-omgwtf-cli-executed-drac-console

Interestingly enough as you can see from the script to fetch the jar file from the drac you do need to get authenticated at all. I find this a bit odd, but at least we can abuse it.

If things go well, you should get a similar outcome:

dell drac from cli

Join the conversation

1 Comment

Leave a comment

Your e-mail address will not be published. Required fields are marked *