use ipmi interface from node.NodeConf
Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
committed by
Jonathon Anderson
parent
37bf90c588
commit
10ea0ac78d
@@ -44,20 +44,10 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
wwlog.Error("%s: No IPMI IP address", node.Id())
|
wwlog.Error("%s: No IPMI IP address", node.Id())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
var conf node.NodeConf
|
||||||
ipmiCmd := power.IPMI{
|
conf.GetFrom(n)
|
||||||
NodeName: node.Id(),
|
ipmiCmd := power.IPMI{IpmiConf: *conf.Ipmi}
|
||||||
HostName: node.Ipmi.Ipaddr.String(),
|
|
||||||
Port: node.Ipmi.Port,
|
|
||||||
User: node.Ipmi.UserName,
|
|
||||||
Password: node.Ipmi.Password,
|
|
||||||
AuthType: "MD5",
|
|
||||||
Interface: node.Ipmi.Interface,
|
|
||||||
EscapeChar: node.Ipmi.EscapeChar,
|
|
||||||
}
|
|
||||||
|
|
||||||
err := ipmiCmd.Console()
|
err := ipmiCmd.Console()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wwlog.Error("%s: Console problem", node.Id())
|
wwlog.Error("%s: Console problem", node.Id())
|
||||||
returnErr = err
|
returnErr = err
|
||||||
|
|||||||
@@ -49,26 +49,10 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
wwlog.Error("%s: No IPMI IP address", node.Id())
|
wwlog.Error("%s: No IPMI IP address", node.Id())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
var ipmiInterface = "lan"
|
var conf node.NodeConf
|
||||||
if node.Ipmi.Interface != "" {
|
conf.GetFrom(n)
|
||||||
ipmiInterface = node.Ipmi.Interface
|
ipmiCmd := power.IPMI{IpmiConf: *conf.Ipmi}
|
||||||
}
|
|
||||||
var ipmiPort = "623"
|
|
||||||
if node.Ipmi.Port != "" {
|
|
||||||
ipmiPort = node.Ipmi.Port
|
|
||||||
}
|
|
||||||
ipmiCmd := power.IPMI{
|
|
||||||
NodeName: node.Id(),
|
|
||||||
HostName: node.Ipmi.Ipaddr.String(),
|
|
||||||
Port: ipmiPort,
|
|
||||||
User: node.Ipmi.UserName,
|
|
||||||
Password: node.Ipmi.Password,
|
|
||||||
Interface: ipmiInterface,
|
|
||||||
AuthType: "MD5",
|
|
||||||
}
|
|
||||||
|
|
||||||
fullFlag := full
|
fullFlag := full
|
||||||
|
|
||||||
batchpool.Submit(func() {
|
batchpool.Submit(func() {
|
||||||
if fullFlag {
|
if fullFlag {
|
||||||
//nolint:errcheck
|
//nolint:errcheck
|
||||||
@@ -90,12 +74,12 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
out, err := result.Result()
|
out, err := result.Result()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wwlog.Error("%s: %s", result.NodeName, out)
|
wwlog.Error("%s: %s", result.Ipaddr, out)
|
||||||
returnErr = err
|
returnErr = err
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("%s:\n%s\n", result.NodeName, out)
|
fmt.Printf("%s:\n%s\n", result.Ipaddr, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnErr
|
return returnErr
|
||||||
|
|||||||
@@ -41,30 +41,15 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
jobcount := len(nodes)
|
jobcount := len(nodes)
|
||||||
results := make(chan power.IPMI, jobcount)
|
results := make(chan power.IPMI, jobcount)
|
||||||
|
|
||||||
for _, node := range nodes {
|
for _, n := range nodes {
|
||||||
|
|
||||||
if node.Ipmi.Ipaddr.IsUnspecified() {
|
if node.Ipmi.Ipaddr.IsUnspecified() {
|
||||||
wwlog.Error("%s: No IPMI IP address", node.Id())
|
wwlog.Error("%s: No IPMI IP address", node.Id())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
var ipmiInterface = "lan"
|
var conf node.NodeConf
|
||||||
if node.Ipmi.Interface != "" {
|
conf.GetFrom(n)
|
||||||
ipmiInterface = node.Ipmi.Interface
|
ipmiCmd := power.IPMI{IpmiConf: *conf.Ipmi}
|
||||||
}
|
|
||||||
var ipmiPort = "623"
|
|
||||||
if node.Ipmi.Port != "" {
|
|
||||||
ipmiPort = node.Ipmi.Port
|
|
||||||
}
|
|
||||||
ipmiCmd := power.IPMI{
|
|
||||||
NodeName: node.Id(),
|
|
||||||
HostName: node.Ipmi.Ipaddr.String(),
|
|
||||||
Port: ipmiPort,
|
|
||||||
User: node.Ipmi.UserName,
|
|
||||||
Password: node.Ipmi.Password,
|
|
||||||
Interface: ipmiInterface,
|
|
||||||
AuthType: "MD5",
|
|
||||||
}
|
|
||||||
|
|
||||||
batchpool.Submit(func() {
|
batchpool.Submit(func() {
|
||||||
//nolint:errcheck
|
//nolint:errcheck
|
||||||
ipmiCmd.PowerCycle()
|
ipmiCmd.PowerCycle()
|
||||||
@@ -82,12 +67,12 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
out, err := result.Result()
|
out, err := result.Result()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wwlog.Error("%s: %s", result.NodeName, out)
|
wwlog.Error("%s: %s", result.Ipaddr, out)
|
||||||
returnErr = err
|
returnErr = err
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("%s: %s\n", result.NodeName, out)
|
fmt.Printf("%s: %s\n", result.Ipaddr, out)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,24 +47,9 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
wwlog.Error("%s: No IPMI IP address", node.Id())
|
wwlog.Error("%s: No IPMI IP address", node.Id())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
var ipmiInterface = "lan"
|
var conf node.NodeConf
|
||||||
if node.Ipmi.Interface != "" {
|
conf.GetFrom(n)
|
||||||
ipmiInterface = node.Ipmi.Interface
|
ipmiCmd := power.IPMI{IpmiConf: *conf.Ipmi}
|
||||||
}
|
|
||||||
var ipmiPort = "623"
|
|
||||||
if node.Ipmi.Port != "" {
|
|
||||||
ipmiPort = node.Ipmi.Port
|
|
||||||
}
|
|
||||||
ipmiCmd := power.IPMI{
|
|
||||||
NodeName: node.Id(),
|
|
||||||
HostName: node.Ipmi.Ipaddr.String(),
|
|
||||||
Port: ipmiPort,
|
|
||||||
User: node.Ipmi.UserName,
|
|
||||||
Password: node.Ipmi.Password,
|
|
||||||
Interface: ipmiInterface,
|
|
||||||
AuthType: "MD5",
|
|
||||||
}
|
|
||||||
|
|
||||||
batchpool.Submit(func() {
|
batchpool.Submit(func() {
|
||||||
//nolint:errcheck
|
//nolint:errcheck
|
||||||
ipmiCmd.PowerOff()
|
ipmiCmd.PowerOff()
|
||||||
@@ -82,12 +67,12 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
out, err := result.Result()
|
out, err := result.Result()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wwlog.Error("%s: %s", result.NodeName, out)
|
wwlog.Error("%s: %s", result.Ipaddr, out)
|
||||||
returnErr = err
|
returnErr = err
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("%s: %s\n", result.NodeName, out)
|
fmt.Printf("%s: %s\n", result.Ipaddr, out)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,24 +47,9 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
wwlog.Error("%s: No IPMI IP address", node.Id())
|
wwlog.Error("%s: No IPMI IP address", node.Id())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
var ipmiInterface = "lan"
|
var conf node.NodeConf
|
||||||
if node.Ipmi.Interface != "" {
|
conf.GetFrom(n)
|
||||||
ipmiInterface = node.Ipmi.Interface
|
ipmiCmd := power.IPMI{IpmiConf: *conf.Ipmi}
|
||||||
}
|
|
||||||
var ipmiPort = "623"
|
|
||||||
if node.Ipmi.Port != "" {
|
|
||||||
ipmiPort = node.Ipmi.Port
|
|
||||||
}
|
|
||||||
ipmiCmd := power.IPMI{
|
|
||||||
NodeName: node.Id(),
|
|
||||||
HostName: node.Ipmi.Ipaddr.String(),
|
|
||||||
Port: ipmiPort,
|
|
||||||
User: node.Ipmi.UserName,
|
|
||||||
Password: node.Ipmi.Password,
|
|
||||||
Interface: ipmiInterface,
|
|
||||||
AuthType: "MD5",
|
|
||||||
}
|
|
||||||
|
|
||||||
batchpool.Submit(func() {
|
batchpool.Submit(func() {
|
||||||
//nolint:errcheck
|
//nolint:errcheck
|
||||||
ipmiCmd.PowerOn()
|
ipmiCmd.PowerOn()
|
||||||
@@ -82,12 +67,12 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
out, err := result.Result()
|
out, err := result.Result()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wwlog.Error("%s: %s", result.NodeName, out)
|
wwlog.Error("%s: %s", result.Ipaddr, out)
|
||||||
returnErr = err
|
returnErr = err
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("%s: %s\n", result.NodeName, out)
|
fmt.Printf("%s: %s\n", result.Ipaddr, out)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,30 +41,15 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
jobcount := len(nodes)
|
jobcount := len(nodes)
|
||||||
results := make(chan power.IPMI, jobcount)
|
results := make(chan power.IPMI, jobcount)
|
||||||
|
|
||||||
for _, node := range nodes {
|
for _, n := range nodes {
|
||||||
|
|
||||||
if node.Ipmi.Ipaddr.IsUnspecified() {
|
if node.Ipmi.Ipaddr.IsUnspecified() {
|
||||||
wwlog.Error("%s: No IPMI IP address", node.Id())
|
wwlog.Error("%s: No IPMI IP address", node.Id())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
var ipmiInterface = "lan"
|
var conf node.NodeConf
|
||||||
if node.Ipmi.Interface != "" {
|
conf.GetFrom(n)
|
||||||
ipmiInterface = node.Ipmi.Interface
|
ipmiCmd := power.IPMI{IpmiConf: *conf.Ipmi}
|
||||||
}
|
|
||||||
var ipmiPort = "623"
|
|
||||||
if node.Ipmi.Port != "" {
|
|
||||||
ipmiPort = node.Ipmi.Port
|
|
||||||
}
|
|
||||||
ipmiCmd := power.IPMI{
|
|
||||||
NodeName: node.Id(),
|
|
||||||
HostName: node.Ipmi.Ipaddr.String(),
|
|
||||||
Port: ipmiPort,
|
|
||||||
User: node.Ipmi.UserName,
|
|
||||||
Password: node.Ipmi.Password,
|
|
||||||
Interface: ipmiInterface,
|
|
||||||
AuthType: "MD5",
|
|
||||||
}
|
|
||||||
|
|
||||||
batchpool.Submit(func() {
|
batchpool.Submit(func() {
|
||||||
//nolint:errcheck
|
//nolint:errcheck
|
||||||
ipmiCmd.PowerReset()
|
ipmiCmd.PowerReset()
|
||||||
@@ -82,12 +67,12 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
out, err := result.Result()
|
out, err := result.Result()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wwlog.Error("%s: %s", result.NodeName, out)
|
wwlog.Error("%s: %s", result.Ipaddr, out)
|
||||||
returnErr = err
|
returnErr = err
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("%s: %s\n", result.NodeName, out)
|
fmt.Printf("%s: %s\n", result.Ipaddr, out)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,30 +41,15 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
jobcount := len(nodes)
|
jobcount := len(nodes)
|
||||||
results := make(chan power.IPMI, jobcount)
|
results := make(chan power.IPMI, jobcount)
|
||||||
|
|
||||||
for _, node := range nodes {
|
for _, n := range nodes {
|
||||||
|
|
||||||
if node.Ipmi.Ipaddr.IsUnspecified() {
|
if node.Ipmi.Ipaddr.IsUnspecified() {
|
||||||
wwlog.Error("%s: No IPMI IP address", node.Id())
|
wwlog.Error("%s: No IPMI IP address", node.Id())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
var ipmiInterface = "lan"
|
var conf node.NodeConf
|
||||||
if node.Ipmi.Interface != "" {
|
conf.GetFrom(n)
|
||||||
ipmiInterface = node.Ipmi.Interface
|
ipmiCmd := power.IPMI{IpmiConf: *conf.Ipmi}
|
||||||
}
|
|
||||||
var ipmiPort = "623"
|
|
||||||
if node.Ipmi.Port != "" {
|
|
||||||
ipmiPort = node.Ipmi.Port
|
|
||||||
}
|
|
||||||
ipmiCmd := power.IPMI{
|
|
||||||
NodeName: node.Id(),
|
|
||||||
HostName: node.Ipmi.Ipaddr.String(),
|
|
||||||
Port: ipmiPort,
|
|
||||||
User: node.Ipmi.UserName,
|
|
||||||
Password: node.Ipmi.Password,
|
|
||||||
Interface: ipmiInterface,
|
|
||||||
AuthType: "MD5",
|
|
||||||
}
|
|
||||||
|
|
||||||
batchpool.Submit(func() {
|
batchpool.Submit(func() {
|
||||||
//nolint:errcheck
|
//nolint:errcheck
|
||||||
ipmiCmd.PowerSoft()
|
ipmiCmd.PowerSoft()
|
||||||
@@ -82,12 +67,12 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
out, err := result.Result()
|
out, err := result.Result()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wwlog.Error("%s: %s", result.NodeName, out)
|
wwlog.Error("%s: %s", result.Ipaddr, out)
|
||||||
returnErr = err
|
returnErr = err
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("%s: %s\n", result.NodeName, out)
|
fmt.Printf("%s: %s\n", result.Ipaddr, out)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,30 +41,15 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
jobcount := len(nodes)
|
jobcount := len(nodes)
|
||||||
results := make(chan power.IPMI, jobcount)
|
results := make(chan power.IPMI, jobcount)
|
||||||
|
|
||||||
for _, node := range nodes {
|
for _, n := range nodes {
|
||||||
|
|
||||||
if node.Ipmi.Ipaddr.IsUnspecified() {
|
if node.Ipmi.Ipaddr.IsUnspecified() {
|
||||||
wwlog.Error("%s: No IPMI IP address", node.Id())
|
wwlog.Error("%s: No IPMI IP address", node.Id())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
var ipmiInterface = "lan"
|
var conf node.NodeConf
|
||||||
if node.Ipmi.Interface != "" {
|
conf.GetFrom(n)
|
||||||
ipmiInterface = node.Ipmi.Interface
|
ipmiCmd := power.IPMI{IpmiConf: *conf.Ipmi}
|
||||||
}
|
|
||||||
var ipmiPort = "623"
|
|
||||||
if node.Ipmi.Port != "" {
|
|
||||||
ipmiPort = node.Ipmi.Port
|
|
||||||
}
|
|
||||||
ipmiCmd := power.IPMI{
|
|
||||||
NodeName: node.Id(),
|
|
||||||
HostName: node.Ipmi.Ipaddr.String(),
|
|
||||||
Port: ipmiPort,
|
|
||||||
User: node.Ipmi.UserName,
|
|
||||||
Password: node.Ipmi.Password,
|
|
||||||
Interface: ipmiInterface,
|
|
||||||
AuthType: "MD5",
|
|
||||||
}
|
|
||||||
|
|
||||||
batchpool.Submit(func() {
|
batchpool.Submit(func() {
|
||||||
//nolint:errcheck
|
//nolint:errcheck
|
||||||
ipmiCmd.PowerStatus()
|
ipmiCmd.PowerStatus()
|
||||||
@@ -82,12 +67,12 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
|||||||
out, err := result.Result()
|
out, err := result.Result()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wwlog.Error("%s: %s", result.NodeName, out)
|
wwlog.Error("%s: %s", result.Ipaddr, out)
|
||||||
returnErr = err
|
returnErr = err
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("%s: %s\n", result.NodeName, out)
|
fmt.Printf("%s: %s\n", result.Ipaddr, out)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,16 +59,17 @@ type ProfileConf struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type IpmiConf struct {
|
type IpmiConf struct {
|
||||||
UserName string `yaml:"username,omitempty" lopt:"ipmiuser" comment:"Set the IPMI username"`
|
UserName string `yaml:"username,omitempty" lopt:"ipmiuser" comment:"Set the IPMI username"`
|
||||||
Password string `yaml:"password,omitempty" lopt:"ipmipass" comment:"Set the IPMI password"`
|
Password string `yaml:"password,omitempty" lopt:"ipmipass" comment:"Set the IPMI password"`
|
||||||
Ipaddr net.IP `yaml:"ipaddr,omitempty" lopt:"ipmiaddr" comment:"Set the IPMI IP address" type:"IP"`
|
Ipaddr net.IP `yaml:"ipaddr,omitempty" lopt:"ipmiaddr" comment:"Set the IPMI IP address" type:"IP"`
|
||||||
Gateway net.IP `yaml:"gateway,omitempty" lopt:"ipmigateway" comment:"Set the IPMI gateway" type:"IP"`
|
Gateway net.IP `yaml:"gateway,omitempty" lopt:"ipmigateway" comment:"Set the IPMI gateway" type:"IP"`
|
||||||
Netmask net.IP `yaml:"netmask,omitempty" lopt:"ipminetmask" comment:"Set the IPMI netmask" type:"IP"`
|
Netmask net.IP `yaml:"netmask,omitempty" lopt:"ipminetmask" comment:"Set the IPMI netmask" type:"IP"`
|
||||||
Port string `yaml:"port,omitempty" lopt:"ipmiport" comment:"Set the IPMI port"`
|
Port string `yaml:"port,omitempty" lopt:"ipmiport" comment:"Set the IPMI port"`
|
||||||
Interface string `yaml:"interface,omitempty" lopt:"ipmiinterface" comment:"Set the node's IPMI interface (defaults: 'lan')"`
|
Interface string `yaml:"interface,omitempty" lopt:"ipmiinterface" comment:"Set the node's IPMI interface (defaults: 'lan')"`
|
||||||
EscapeChar string `yaml:"escapechar,omitempty" lopt:"ipmiescapechar" comment:"Set the IPMI escape character (defaults: '~')"`
|
EscapeChar string `yaml:"escapechar,omitempty" lopt:"ipmiescapechar" comment:"Set the IPMI escape character (defaults: '~')"`
|
||||||
Write wwtype.WWbool `yaml:"write,omitempty" lopt:"ipmiwrite" comment:"Enable the write of impi configuration (true/false)"`
|
Write wwtype.WWbool `yaml:"write,omitempty" lopt:"ipmiwrite" comment:"Enable the write of impi configuration (true/false)"`
|
||||||
Tags map[string]string `yaml:"tags,omitempty"`
|
BmcTemplate string `yaml:"template,omitempty" lopt:"ipmitemplate" comment:"template used for ipmi command"`
|
||||||
|
Tags map[string]string `yaml:"tags,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type KernelConf struct {
|
type KernelConf struct {
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/hpcng/warewulf/internal/pkg/node"
|
||||||
)
|
)
|
||||||
|
|
||||||
type IPMIResult struct {
|
type IPMIResult struct {
|
||||||
@@ -12,15 +14,8 @@ type IPMIResult struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type IPMI struct {
|
type IPMI struct {
|
||||||
NodeName string
|
node.IpmiConf
|
||||||
HostName string
|
result IPMIResult
|
||||||
Port string
|
|
||||||
User string
|
|
||||||
Password string
|
|
||||||
AuthType string
|
|
||||||
Interface string
|
|
||||||
EscapeChar string
|
|
||||||
result IPMIResult
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ipmi *IPMI) Result() (string, error) {
|
func (ipmi *IPMI) Result() (string, error) {
|
||||||
@@ -40,7 +35,7 @@ func (ipmi *IPMI) Command(ipmiArgs []string) ([]byte, error) {
|
|||||||
if ipmi.EscapeChar == "" {
|
if ipmi.EscapeChar == "" {
|
||||||
ipmi.EscapeChar = "~"
|
ipmi.EscapeChar = "~"
|
||||||
}
|
}
|
||||||
args = append(args, "-I", ipmi.Interface, "-H", ipmi.HostName, "-p", ipmi.Port, "-U", ipmi.User, "-P", ipmi.Password, "-e", ipmi.EscapeChar)
|
args = append(args, "-I", ipmi.Interface, "-H", ipmi.Ipaddr, "-p", ipmi.Port, "-U", ipmi.UserName, "-P", ipmi.Password, "-e", ipmi.EscapeChar)
|
||||||
args = append(args, ipmiArgs...)
|
args = append(args, ipmiArgs...)
|
||||||
ipmiCmd := exec.Command("ipmitool", args...)
|
ipmiCmd := exec.Command("ipmitool", args...)
|
||||||
return ipmiCmd.CombinedOutput()
|
return ipmiCmd.CombinedOutput()
|
||||||
@@ -59,7 +54,7 @@ func (ipmi *IPMI) InteractiveCommand(ipmiArgs []string) error {
|
|||||||
if ipmi.EscapeChar == "" {
|
if ipmi.EscapeChar == "" {
|
||||||
ipmi.EscapeChar = "~"
|
ipmi.EscapeChar = "~"
|
||||||
}
|
}
|
||||||
args = append(args, "-I", ipmi.Interface, "-H", ipmi.HostName, "-p", ipmi.Port, "-U", ipmi.User, "-P", ipmi.Password, "-e", ipmi.EscapeChar)
|
args = append(args, "-I", ipmi.Interface, "-H", ipmi.Ipaddr, "-p", ipmi.Port, "-U", ipmi.UserName, "-P", ipmi.Password, "-e", ipmi.EscapeChar)
|
||||||
args = append(args, ipmiArgs...)
|
args = append(args, ipmiArgs...)
|
||||||
ipmiCmd := exec.Command("ipmitool", args...)
|
ipmiCmd := exec.Command("ipmitool", args...)
|
||||||
ipmiCmd.Stdout = os.Stdout
|
ipmiCmd.Stdout = os.Stdout
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
package power
|
package power
|
||||||
|
|
||||||
//type PowerControl interface {
|
|
||||||
//PowerOn() (result string, err error)
|
|
||||||
//PowerOff() (result string, err error)
|
|
||||||
//PowerStatus() (result string, err error)
|
|
||||||
//}
|
|
||||||
|
|
||||||
type PowerOnInterface interface {
|
type PowerOnInterface interface {
|
||||||
PowerOn() (result string, err error)
|
PowerOn() (result string, err error)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user