Native Go implementation of IPMI. It does not shell out to ipmitool.
The library provides an IPMI client (remote and in-band) and a reference IPMI
server (BMC) for local development and tests, plus the protocol types they share.
Public APIs live under pkg/. To use the client, start with pkg/client.
This module has not reached v1.0.0. The public API may change between
versions, including renamed packages, types, functions, and constants.
Pin to a specific version or commit for production use.
v0 releases carry no backward-compatibility promise, per the
Go module versioning convention.
go get github.com/bougou/go-ipmipackage main
import (
"context"
"fmt"
"github.com/bougou/go-ipmi/pkg/client"
)
func main() {
c, err := client.NewClient("10.0.0.1", 623, "root", "123456")
if err != nil {
panic(err)
}
// c.WithInterface(client.InterfaceLan) // IPMI v1.5; default is lanplus (v2.0)
// openClient, err := client.NewOpenClient() // in-band on Linux / Windows
ctx := context.Background()
if err := c.Connect(ctx); err != nil {
panic(err)
}
defer c.Close(ctx)
res, err := c.GetDeviceID(ctx)
if err != nil {
panic(err)
}
fmt.Println(res.Format())
}Interfaces, options, and helpers: docs/client.md.
Import path changes since v0.8.x: docs/migration.md.
goipmi-server is a dual-stack reference BMC (RMCP+ and IPMI v1.5 on one UDP
port). Build with make build, then run _output/goipmi-server. Defaults are
user/password ADMIN/ADMIN on port 623.
Embedding the same stack in-process is described in docs/server.md.
make build
./_output/goipmi -I lanplus -H <bmc> -U <user> -P <pass> mc info
./_output/goipmi-servergoipmi mirrors common ipmitool subcommands so the library can be exercised
against real BMCs. It is a verification front-end, not a drop-in replacement.
Checked-in copies (including IPMI v1.5) are under specs/.