Documentation ¶
Index ¶
- Constants
- type BMCInfo
- type Bootdev
- type Fru
- type Ipmi
- type Ipmitool
- func (i *Ipmitool) CreateUser(username, uid string, privilege Privilege) (string, error)
- func (i *Ipmitool) DevicePresent() bool
- func (i *Ipmitool) EnableUEFI(bootdev Bootdev, persistent bool) error
- func (i *Ipmitool) GetBMCInfo() (BMCInfo, error)
- func (i *Ipmitool) GetFru() (Fru, error)
- func (i *Ipmitool) GetLanConfig() (LanConfig, error)
- func (i *Ipmitool) GetSession() (Session, error)
- func (i *Ipmitool) Run(args ...string) (string, error)
- type LanConfig
- type Privilege
- type Session
Constants ¶
const ( // Command is the ipmi cli to execute Command = command.IPMITool // Callback ipmi privilege Callback = Privilege(1) // User ipmi privilege User = Privilege(2) // Operator ipmi privilege Operator = Privilege(3) // Administrator ipmi privilege Administrator = Privilege(4) // OEM ipmi privilege OEM = Privilege(5) // NoAccess ipmi privilege NoAccess = Privilege(15) )
const ( // PXE boot server via PXE PXE = Bootdev("pxe") // Disk boot server from hard disk Disk = Bootdev("disk") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BMCInfo ¶
type BMCInfo struct { // # ipmitool bmc info // Device ID : 32 // Device Revision : 1 // Firmware Revision : 1.64 // IPMI Version : 2.0 // Manufacturer ID : 10876 // Manufacturer Name : Supermicro // Product ID : 2402 (0x0962) // Product Name : Unknown (0x962) // Device Available : yes // Provides Device SDRs : no // Additional Device Support : FirmwareRevision string `ipmitool:"Firmware Revision"` }
BMCInfo contains the parsed output of ipmitool bmc info
type Fru ¶
type Fru struct { ChassisPartNumber string `ipmitool:"Chassis Part Number"` ChassisPartSerial string `ipmitool:"Chassis Serial"` BoardMfg string `ipmitool:"Board Mfg"` BoardMfgSerial string `ipmitool:"Board Mfg Serial"` BoardPartNumber string `ipmitool:"Board Part Number"` ProductManufacturer string `ipmitool:"Product Manufacturer"` ProductPartNumber string `ipmitool:"Product Part Number"` ProductSerial string `ipmitool:"Product Serial"` }
Fru contains Field Replacable Unit information, retrieved with ipmitool fru
type Ipmi ¶
type Ipmi interface { DevicePresent() bool Run(arg ...string) (string, error) CreateUser(username, uid string, privilege Privilege) (string, error) GetLanConfig() (LanConfig, error) EnableUEFI(bootdev Bootdev, persistent bool) error GetFru() (Fru, error) GetSession() (Session, error) GetBMCInfo() (BMCInfo, error) }
Ipmi defines methods to interact with ipmi
type Ipmitool ¶
type Ipmitool struct {
Command string
}
Ipmitool is used to query and modify the IPMI based BMC from the host os.
func (*Ipmitool) CreateUser ¶
CreateUser create a ipmi user with password and privilege level
func (*Ipmitool) DevicePresent ¶
DevicePresent returns true if the ipmi device is present, which is required to talk to the BMC.
func (*Ipmitool) EnableUEFI ¶
EnableUEFI set the firmware to boot with uefi for given bootdev, bootdev can be one of pxe|disk if persistent is set to true this will last for every subsequent boot, not only the next.
func (*Ipmitool) GetBMCInfo ¶
GetBMCInfo returns the bmc info
func (*Ipmitool) GetLanConfig ¶
GetLanConfig returns the LanConfig
func (*Ipmitool) GetSession ¶
GetSession returns the Session info