Skip to content

Instantly share code, notes, and snippets.

@pierrelefevre
Last active May 27, 2024 20:14
Show Gist options
  • Save pierrelefevre/ab059cde38f063204f2cc6160b63eb82 to your computer and use it in GitHub Desktop.
Save pierrelefevre/ab059cde38f063204f2cc6160b63eb82 to your computer and use it in GitHub Desktop.
Change User string on Dell servers iDRAC LCD display

Introduction

While trying to set our Dell servers to have a helpful asset tag on the LCDs, we noticed that ipmitool's delloem set mode function was not working. Seeing as ipmitool is on hold due to sanctions, we tried to find an alternative solution.

From some old mailing list thread [0], and a blog post[1], we managed to change the LCD user string, however only when manually setting "Home" to be User String.

By staring at the code for a couple hours, we figured out why the existing set LCD mode command was not working - the 0x00 sent was not enough, as multiple parameters needed to be set each time. By adding the trailing zeroes, this command now works on our Precision 7920 Rack machines.

The code

#!/usr/bin/python3

from subprocess import call
from sys import argv

user_string = ' '.join(argv[1:])[:14]
hex_string = ' '.join([hex(ord(z)) for z in user_string])

call('/usr/bin/ipmitool raw 0x6 0x58 0xC2 0 0 0 0 0 0 0 0 0 0 0 0', shell=True)
call('/usr/bin/ipmitool raw 0x6 0x58 0xC1 0 0 {0} {1}'.format(str(len(user_string)), hex_string), shell=True)

Adapting this to your use case

To get it to work, you might have to change the path to ipmitool, and perhaps add interface, host, password, etc. arguments depending on your setup.

Credits

This was done by Emil Karlsson and I, while working on kthcloud.

See the original creators in the sources below.

License

This code is licensed under the MIT license. Feel free to use it :)

Sources

[0] https://www.mail-archive.com/ipmitool-devel@lists.sourceforge.net/msg00352.html

[1] https://www.tannr.com/2010/03/20/changing-an-lcd-string-on-a-dell-server-remotely-with-python/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment