Coder Social home page Coder Social logo

go-ipmi's Introduction

go-ipmi

go-ipmi is a pure golang native IPMI library. It DOES NOT wraps ipmitool.

Usage

import (
	"fmt"
	"github.com/bougou/go-ipmi"
)

func main() {
	host := "10.0.0.1"
	port := 623
	username := "root"
	password := "123456"

	client, err := ipmi.NewClient(host, port, username, password)
	if err != nil {
		panic(err)
	}

	// you can optionally open debug switch
	// client.WithDebug(true)

	// Connect will create an authenticated session for you.
	if err := client.Connect(); err != nil {
		panic(err)
	}

	// Now you can execute other IPMI commands that need authentication.

	res, err := client.GetDeviceID()
	if err != nil {
		panic(err)
	}
	fmt.Println(res.Format())

	selEntries, err := client.GetSELEntries(0)
	if err != nil {
		panic(err)
	}
	fmt.Println(ipmi.FormatSELs(selEntries, nil))
}

Functions Comparision with ipmitool

More is ongoing ...

IPM Device Global Commands

Note: All IPMI commands are implemented as methods of the ipmi.Client struct.

Method Status corresponding ipmitool usage
GetDeviceID mc info
ColdReset mc reset cold
WarmReset mc reset warm
GetSelfTestResults mc selftest
ManufacturingTestOn
SetACPIPowerState
GetACPIPowerState
GetDeviceGUID
GetNetFnSupport
GetCommandSupport
GetCommandSubfunctionSupport
GetConfigurableCommands
GetConfigurableCommandSubfunctions
SetCommandEnables
GetCommandEnables
GetCommandSubfunctionsEnables
GetSubfunctionsEnables
GetOEMNetFnIanaSupport

BMC Watchdog Timer Commands

Method Status corresponding ipmitool usage
ResetWatchdogTimer
SetWatchdogTimer
GetWatchdogTimer

BMC Device and Messaging Commands

Method Status corresponding ipmitool usage
SetBMCGlobalEnables
GetBMCGlobalEnables
ClearMessageFlags
GetMessageFlags
EnableMessageChannelReceive
GetMessage
SendMessage
ReadEventMessageBuffer
GetBTInterfaceCapabilities
GetSystemGUID mc guid
SetSystemInfoParameters
GetSystemInfoParameters
GetChannelAuthCapabilities
GetSessionChallenge
ActivateSession
SetSessionPrivilegeLevel
CloseSession
GetSessionInfo session info
GetAuthCode
SetChannelAccess channel setaccess
GetChannelAccess channel info/getaccess
GetChannelInfo channel info
SetUserAccess
GetUserAccess user summary
GetUsers (*) user list
SetUsername user set name
DisableUser (*) user disable
EnableUser (*) user enable
GetUsername
SetUserPassword user set password
TestUserPassword(*) user test
ActivatePayload
DeactivatePayload
GetPayloadActivationStatus
GetPayloadInstanceInfo
SetUserPayloadAccess
GetUserPayloadAccess
GetChannelPayloadSupport
GetChannelPayloadVersion
GetChannelOEMPayloadInfo
MasterWriteRead
GetChannelCipherSuites
SuspendOrResumeEncryption
SetChannelCipherSuites
GetSystemInterfaceCapabilities

Chassis Device Commands

Method Status corresponding ipmitool usage
GetChassisCapabilities
GetChassisStatus chassis status
ChassisControl chassis power on/off/cycle/reset/diag/soft
ChassisReset
ChassisIdentify chassis identify
SetChassisCapabilities
SetPowerRestorePolicy chassis policy always-on/previous/always-off
GetSystemRestartCause chassis restart_cause
SetSystemBootOptions
GetSystemBootOptions
SetFrontPanelEnables
SetPowerCycleInterval
GetPOHCounter

Event Commands

Method Status corresponding ipmitool usage
SetEventReceiver
GetEventReceiver
EventMessage

PEF and Alerting Commands

Method Status corresponding ipmitool usage
GetPefCapabilities
ArmPefPostponeTimer
SetPefConfigParameters
GetPefConfigParameters
SetLastProcessedEventId
GetLastProcessedEventId
AlertImmediate
PetAck

Sensor Device Commands

Method Status corresponding ipmitool usage
GetDeviceSDRInfo
GetDeviceSDR
ReserveDeviceSDRRepo
GetSensorReadingFactors
SetSensorHysteresis
GetSensorHysteresis
SetSensorThresholds
GetSensorThresholds
SetSensorEventEnable
GetSensorEventEnable
RearmSensorEvents
GetSensorEventStatus
GetSensorReading
SetSensorType
GetSensorType
SetSensorReadingAndEventStatus

FRU Device Commands

Method Status corresponding ipmitool usage
GetFRUInventoryAreaInfo
ReadFRUData
WriteFRUData

SDR Device Commands

Method Status corresponding ipmitool usage
GetSDRRepoInfo sdr info
GetSDRRepoAllocInfo sdr info
ReserveSDRRepo
GetSDR sdr get
GetSDRs (*) sdr list/elist
AddSDR
PartialAddSDR
DeleteSDR
ClearSDRRepo
GetSDRRepoTime
SetSDRRepoTime
EnterSDRRepoUpateMode
ExitSDRRepoUpdateMode
RunInitializationAgent

SEL Device Commands

Method Status corresponding ipmitool usage
GetSELInfo sel info
GetSELAllocInfo sel info
ReserveSEL
GetSELEntry
AddSELEntry
PartialAddSELEntry
DeleteSELEntry
ClearSEL sel clear
GetSELTime
SetSELTime
GetAuxLogStatus
SetAuxLogStatus
GetSELTimeUtcOffset
SetSELTimeUtcOffset

LAN Device Commands

Method Status corresponding ipmitool usage
SetLanConfigParams
GetLanConfigParams
SuspendARPs
GetIpStatistics

Serial/Modem Device Commands

Method Status corresponding ipmitool usage
SetSerialConfig
GetSerialConfig
SetSerialMux
GetTapResponseCodes
SetPPPTransmitData
GetPPPTransmitData
SendPPPPacket
GetPPPReceiveData
SerialConnectionActive
Callback
SetUserCallbackOptions
GetUserCallbackOptions
SetSerialRoutingMux
SolActivating
GetSolConfigParams
SetSolConfigParams

Command Forwarding Commands

Method Status corresponding ipmitool usage
Fowarded
SetForwarded
GetForwarded
EnableForwarded

Bridge Management Commands (ICMB)

Method Status corresponding ipmitool usage
GetBridgeState
SetBridgeState
GetICMBAddress
SetICMBAddress
SetBridgeProxyAddress
GetBridgeStatistics
GetICMBCapabilities
ClearBridgeStatistics
GetBridgeProxyAddress
GetICMBConnectorInfo
GetICMBConnectionID
SendICMBConnectionID

Discovery Commands (ICMB)

Method Status corresponding ipmitool usage
PrepareForDiscovery
GetAddresses
SetDiscovered
GetChassisDeviceId
SetChassisDeviceId

Bridging Commands (ICMB)

Method Status corresponding ipmitool usage
BridgeRequest
BridgeMessage

Event Commands (ICMB)

Method Status corresponding ipmitool usage
GetEventCount
SetEventDestination
SetEventReceptionState
SendICMBEventMessage
GetEventDestination
GetEventReceptionState

Other Bridge Commands

Method Status corresponding ipmitool usage
ErrorReport

Reference

go-ipmi's People

Contributors

bougou avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.