IDRAC

A Ruby client for the Dell iDRAC API. This gem provides a command-line interface and a Ruby API for interacting with Dell iDRAC servers.

Features

  • Take screenshots of the iDRAC console
  • Update firmware using Dell’s catalog
  • Check for firmware updates
  • Interactive firmware update process

Installation

Add this line to your application’s Gemfile:

gem 'idrac'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install idrac

Usage

Command Line Interface

The gem provides a command-line interface for interacting with iDRAC servers:

# Take a screenshot of the iDRAC console
idrac screenshot --host=192.168.1.100 --username=root --password=calvin
# Specify a custom output filename
idrac screenshot --host=192.168.1.100 --username=root --password=calvin --output=my_screenshot.png

# Download the Dell firmware catalog
idrac firmware:catalog --host=192.168.1.100 --username=root --password=calvin

# Check firmware status and available updates
idrac firmware:status --host=192.168.1.100 --username=root --password=calvin

# Update firmware using a specific file
idrac firmware:update /path/to/firmware.exe --host=192.168.1.100 --username=root --password=calvin

# Interactive firmware update
idrac firmware:interactive --host=192.168.1.100 --username=root --password=calvin

Ruby API

require 'idrac'

# Create a client
client = IDRAC.new(
  host: '192.168.1.100',
  username: 'root',
  password: 'calvin'
)

# Take a screenshot (using the client convenience method)
filename = client.screenshot
puts "Screenshot saved to: #{filename}"

# Or use the Screenshot class directly for more control
screenshot = IDRAC::Screenshot.new(client)
filename = screenshot.capture
puts "Screenshot saved to: #{filename}"

# Firmware operations
firmware = IDRAC::Firmware.new(client)

# Download catalog
catalog_path = firmware.download_catalog

# Get system inventory
inventory = firmware.get_system_inventory
puts "Service Tag: #{inventory[:system][:service_tag]}"

# Check for updates
updates = firmware.check_updates(catalog_path)
updates.each do |update|
  puts "#{update[:name]}: #{update[:current_version]} -> #{update[:available_version]}"
end

# Update firmware
job_id = firmware.update('/path/to/firmware.exe', wait: true)
puts "Update completed with job ID: #{job_id}"

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/usiegj00/idrac.