A Ruby client library for interacting with Supermicro BMC (Baseboard Management Controller) via the Redfish API.
This gem provides a Ruby interface to manage Supermicro servers through their BMC, offering the same functionality as the iDRAC gem but for Supermicro hardware:
- System Information: Model, serial number, BIOS version, UUID
- CPU: Socket information, cores, threads, speed
- Memory: DIMMs capacity, speed, health status
- Storage: Controllers, physical drives, volumes/RAID configuration
- Network: NICs with MAC addresses, link status, IP configuration
- Power Supplies: Status, wattage, health monitoring
- Thermal: Fan speeds, temperature sensors
- Power Consumption: Current usage, capacity
- Boot Order: Set boot device priority
- Boot Override: One-time or persistent boot device selection
- BIOS Settings: Read and modify BIOS attributes
- Network Protocols: Configure BMC network services
- User Management: Create, modify, delete BMC users
- Mount/Unmount ISO: Attach HTTP-served ISO images
- Virtual Media Status: Check mounted media
- Boot from Virtual Media: Combined mount and boot configuration
- Power Status: Check current power state
- Power Control: On, Off, Restart, Power Cycle
- Graceful Shutdown: Attempt graceful OS shutdown
- System Event Log: View and clear SEL entries
- Jobs/Tasks: Monitor long-running operations
- Active Sessions: View current BMC sessions
Add to your Gemfile:
gem 'supermicro'Or install directly:
gem install supermicrorequire 'supermicro'
# Create a client
client = Supermicro.new(
host: '192.168.1.100',
username: 'admin',
password: 'password',
verify_ssl: false
)
# Or use block form with automatic session cleanup
Supermicro.connect(
host: '192.168.1.100',
username: 'admin',
password: 'password'
) do |client|
# Your code here
puts client.power_status
end# Check power status
status = client.power_status # => "On" or "Off"
# Power operations
client.power_on
client.power_off
client.power_restart
client.power_cycle# Get system information
info = client.system_info
# Get CPU information
cpus = client.cpus
# Get memory information
memory = client.memory
# Get storage summary
storage = client.storage_summary
# Get thermal information
fans = client.fans
temps = client.temperatures# Check virtual media status
media = client.virtual_media_status
# Mount an ISO
client.insert_virtual_media("http://example.com/os.iso")
# Unmount all media
client.unmount_all_media
# Mount ISO and set boot override
client.mount_iso_and_boot("http://example.com/os.iso")# Get boot options
options = client.boot_options
# Set one-time boot override
client.set_boot_override("Pxe", persistent: false)
# Quick boot methods
client.boot_to_pxe
client.boot_to_disk
client.boot_to_cd
client.boot_to_bios_setup# Get BIOS attributes
attrs = client.bios_attributes
# Set BIOS attribute
client.set_bios_attribute("QuietBoot", "Enabled")
# Reset BIOS to defaults
client.reset_bios_defaultshost: BMC IP address or hostnameusername: BMC usernamepassword: BMC passwordport: BMC port (default: 443)use_ssl: Use HTTPS (default: true)verify_ssl: Verify SSL certificates (default: false)direct_mode: Use Basic Auth instead of sessions (default: false)retry_count: Number of retries for failed requests (default: 3)retry_delay: Initial delay between retries in seconds (default: 1)
Enable verbose output:
client.verbosity = 1 # Basic debug output
client.verbosity = 2 # Include request/response details
client.verbosity = 3 # Include full stack tracesTested with:
- Supermicro BMC firmware version 01.04.08
- Redfish API version 1.11.0
- Ruby 3.0+
While the API is similar to the iDRAC gem, there are some Supermicro-specific differences:
- URL Paths: Supermicro uses numeric IDs (e.g.,
/Systems/1) instead of Dell's embedded names - Redirects: Supermicro BMC redirects some paths to include trailing slashes
- SEL Path: System Event Log may be at different locations depending on firmware
- Task Management: Task/Job structure differs from Dell's implementation
- Virtual Media: Different action paths and supported media types
Run the test suite:
bundle exec rspecOr with specific tests:
bundle exec rspec spec/supermicro_spec.rbAfter checking out the repo, run bundle install to install dependencies. Then, run bundle exec rspec to run the tests.
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 tags, and push the .gem file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/buildio/supermicro.
MIT