ipmi

package
v2.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ipmi

type Ipmi struct {
	Username string
	Password string
	Host     string
	// contains filtered or unexported fields
}

Ipmi holds the date for an ipmi connection

func New

func New(username string, password string, host string, opts ...Option) (ipmi *Ipmi, err error)

New returns a new ipmi instance

func (*Ipmi) BootDeviceSet

func (i *Ipmi) BootDeviceSet(ctx context.Context, bootDevice string, setPersistent, efiBoot bool) (ok bool, err error)

BootDeviceSet sets the next boot device with options

func (*Ipmi) ClearSystemEventLog

func (i *Ipmi) ClearSystemEventLog(ctx context.Context) (err error)

ClearSystemEventLog clears the system event log

func (*Ipmi) DeactivateSOL added in v2.2.1

func (i *Ipmi) DeactivateSOL(ctx context.Context) (err error)

func (*Ipmi) ForceRestart

func (i *Ipmi) ForceRestart(ctx context.Context) (status bool, err error)

ForceRestart does the chassis power cycle even if the chassis is turned off. From the RedFish spec (https://www.dmtf.org/sites/default/files/standards/documents/DSP2046_2018.1.pdf):

Perform an immediate (non-graceful) shutdown, followed by a restart.

func (*Ipmi) GetSystemEventLog added in v2.2.0

func (i *Ipmi) GetSystemEventLog(ctx context.Context) (entries [][]string, err error)

GetSystemEventLog returns the system event log entries in ID, Timestamp, Description, Message format

func (*Ipmi) GetSystemEventLogRaw added in v2.2.0

func (i *Ipmi) GetSystemEventLogRaw(ctx context.Context) (eventlog string, err error)

GetSystemEventLogRaw returns the raw SEL output

func (*Ipmi) IsOn

func (i *Ipmi) IsOn(ctx context.Context) (status bool, err error)

IsOn tells if a machine is currently powered on

func (*Ipmi) PowerCycle

func (i *Ipmi) PowerCycle(ctx context.Context) (status bool, err error)

PowerCycle reboots the machine via bmc

func (*Ipmi) PowerCycleBmc

func (i *Ipmi) PowerCycleBmc(ctx context.Context) (status bool, err error)

PowerCycleBmc reboots the bmc we are connected to

func (*Ipmi) PowerOff

func (i *Ipmi) PowerOff(ctx context.Context) (status bool, err error)

PowerOff power off the machine via bmc

func (*Ipmi) PowerOn

func (i *Ipmi) PowerOn(ctx context.Context) (status bool, err error)

PowerOn power on the machine via bmc

func (*Ipmi) PowerOnForce

func (i *Ipmi) PowerOnForce(ctx context.Context) (status bool, err error)

PowerOnForce power on the machine via bmc even when the machine is already on (Thanks HP!)

func (*Ipmi) PowerReset

func (i *Ipmi) PowerReset(ctx context.Context) (status bool, err error)

PowerReset reboots the machine via bmc

func (*Ipmi) PowerResetBmc

func (i *Ipmi) PowerResetBmc(ctx context.Context, resetType string) (ok bool, err error)

PowerResetBmc reboots the bmc we are connected to

func (*Ipmi) PowerSoft

func (i *Ipmi) PowerSoft(ctx context.Context) (status bool, err error)

PowerSoft power off the machine via bmc

func (*Ipmi) PowerState

func (i *Ipmi) PowerState(ctx context.Context) (state string, err error)

PowerState returns the current power state of the machine

func (*Ipmi) PxeOnce

func (i *Ipmi) PxeOnce(ctx context.Context) (status bool, err error)

PxeOnce makes the machine to boot via pxe once using MBR

func (*Ipmi) PxeOnceEfi

func (i *Ipmi) PxeOnceEfi(ctx context.Context) (status bool, err error)

PxeOnceEfi makes the machine to boot via pxe once using EFI

func (*Ipmi) PxeOnceMbr

func (i *Ipmi) PxeOnceMbr(ctx context.Context) (status bool, err error)

PxeOnceMbr makes the machine to boot via pxe once using MBR

func (*Ipmi) ReadUsers

func (i *Ipmi) ReadUsers(ctx context.Context) (users []map[string]string, err error)

ReadUsers list all BMC users

func (*Ipmi) SendPowerDiag added in v2.2.3

func (i *Ipmi) SendPowerDiag(ctx context.Context) error

SendPowerDiag tells the BMC to issue an NMI to the device

type Option

type Option func(*Ipmi)

Option for setting optional Ipmi values

func WithCipherSuite

func WithCipherSuite(cipherSuite string) Option

func WithIpmitoolPath

func WithIpmitoolPath(path string) Option

func WithLogger

func WithLogger(log logr.Logger) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL