Documentation
¶
Overview ¶
Package ipmi implements in-band communication with BMC using IPMI commands using `/dev/ipmi*` device.
Index ¶
Constants ¶
View Source
const ( IPMICTL_SET_GETS_EVENTS_CMD = 0x80046910 //nolint:stylecheck IPMICTL_SEND_COMMAND = 0x8028690d //nolint:stylecheck IPMICTL_RECEIVE_MSG_TRUNC = 0xc030690b //nolint:stylecheck IPMI_SYSTEM_INTERFACE_ADDR_TYPE = 0xC //nolint:stylecheck IPMI_BMC_CHANNEL = 0xF //nolint:stylecheck )
IPMI related constants.
View Source
const ( IPMI_DCMI = 0xDC //nolint:stylecheck IPMI_DCMI_GETRED = 0x2 //nolint:stylecheck IPMI_NETFN_DCGRP = 0x2C //nolint:stylecheck IPMI_DCMI_ACTIVATED = 0x40 //nolint:stylecheck )
IPMI DCMI related constants.
View Source
const ( IPMI_LAN = 0x1 //nolint:stylecheck IPMI_LANP_IP_ADDR = 0x2 //nolint:stylecheck IPMI_NETFN_TRANSPORT = 0xC //nolint:stylecheck )
IPMI DCMI related constants.
View Source
const (
// NFDBitS is the amount of bits per mask.
NFDBits = 8 * 8
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IPMIClient ¶
func NewIPMIClient ¶
func NewIPMIClient(devNum int, logger *slog.Logger) (*IPMIClient, error)
NewIPMIClient returns a new instance of IPMIClient struct.
func (*IPMIClient) Do ¶
func (i *IPMIClient) Do(req *ipmiReq, t time.Duration) (*ipmiResp, error)
Do sends IPMI request and returns the response.
func (*IPMIClient) LanIP ¶
func (i *IPMIClient) LanIP(timeout time.Duration) (*string, error)
LanIP returns the IP address of BMC.
func (*IPMIClient) PowerReading ¶
func (i *IPMIClient) PowerReading(timeout time.Duration) (*PowerReading, error)
PowerReading returns the current IPMI DCMI power reading.
type PowerReading ¶
Click to show internal directories.
Click to hide internal directories.