Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

some useage case #13

Open
madwolfcrazy opened this issue Oct 27, 2020 · 1 comment
Open

some useage case #13

madwolfcrazy opened this issue Oct 27, 2020 · 1 comment

Comments

@madwolfcrazy
Copy link

I am using this library recently, Summarized a few examples, hope helpful for you

 // init connection  
    newConn := ipmi.Connection{ 
	Hostname:  job.IPMIIP, 
	Port:      623, 
	Username:  job.IPMIUser, 
	Password:  job.IPMIPWD, 
	Interface: "lanplus", 
} 
cli, err := ipmi.NewClient(&newConn) 
if err != nil { 
	log.Print(err) 
	return err 
} 
defer cli.Close() 
// set machine next boot mode is PXE boot 
err = cli.SetBootDevice(ipmi.BootDevicePxe) 
if err != nil { 
	log.Println("set boot PXE", err) 
	return err 
} 
// restart machine 
time.Sleep(2 * time.Second) 
err = cli.Control(ipmi.ControlPowerHardReset) 
if err != nil { 
	return err 
} 

BTW, I can't find some way to get power status , any idea?

@rgl
Copy link

rgl commented Jul 22, 2021

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants