ipmi

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseBMCMAC

func ParseBMCMAC(mac string) (net.HardwareAddr, error)

ParseBMCMAC parses a MAC address string into net.HardwareAddr.

func ValidateBootDevice

func ValidateBootDevice(device string) error

ValidateBootDevice checks if a boot device string is valid.

Types

type BMCNetConfig

type BMCNetConfig struct {
	IPAddress   string `json:"ipAddress"`
	Netmask     string `json:"netmask"`
	Gateway     string `json:"gateway"`
	MACAddress  string `json:"macAddress"`
	DHCP        bool   `json:"dhcp"`
	VLANEnabled bool   `json:"vlanEnabled"`
	VLANID      int    `json:"vlanId"`
}

BMCNetConfig holds BMC network configuration.

type BootDevice

type BootDevice string

BootDevice represents an IPMI boot target.

const (
	// BootPXE boots from network.
	BootPXE BootDevice = "pxe"
	// BootDisk boots from local disk.
	BootDisk BootDevice = "disk"
	// BootCDROM boots from CD/DVD.
	BootCDROM BootDevice = "cdrom"
	// BootBIOS enters BIOS setup.
	BootBIOS BootDevice = "bios"
)

type ChassisStatus

type ChassisStatus struct {
	PowerOn    bool   `json:"powerOn"`
	PowerFault bool   `json:"powerFault"`
	Intrusion  bool   `json:"intrusion"`
	LastEvent  string `json:"lastEvent"`
}

ChassisStatus holds chassis power state information.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles local IPMI operations via ipmitool.

func New

func New(log *slog.Logger) *Manager

New creates an IPMI manager.

func (*Manager) ChassisControl

func (m *Manager) ChassisControl(ctx context.Context, action string) error

ChassisControl sends a chassis control command (power on/off/cycle/reset).

func (*Manager) DevicePath

func (m *Manager) DevicePath() string

DevicePath returns the IPMI device path.

func (*Manager) GetBMCNetwork

func (m *Manager) GetBMCNetwork(ctx context.Context, channel int) (*BMCNetConfig, error)

GetBMCNetwork reads the BMC network configuration.

func (*Manager) SetNextBoot

func (m *Manager) SetNextBoot(ctx context.Context, device BootDevice) error

SetNextBoot sets the boot device for the next boot only.

type SensorReading

type SensorReading struct {
	Name      string  `json:"name"`
	Value     float64 `json:"value"`
	Unit      string  `json:"unit"`
	Status    string  `json:"status"`
	LowerCrit float64 `json:"lowerCrit,omitempty"`
	UpperCrit float64 `json:"upperCrit,omitempty"`
}

SensorReading represents an IPMI sensor value.

Jump to

Keyboard shortcuts

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