Initial version of command which will cap system

This commit is contained in:
Renan DelValle 2016-10-17 22:12:59 -04:00
parent 7d57957524
commit fbc05a42df

27
pcp/ssh/raplcap.go Normal file
View file

@ -0,0 +1,27 @@
package ssh
import (
"golang.org/x/crypto/ssh"
"fmt"
)
func main() {
sshConfig := &ssh.ClientConfig{
User: "rapl",
Auth: []ssh.AuthMethod{
ssh.Password("pankajlikesdanceswithwolves#!@#"),
},
}
connection, err := ssh.Dial("tcp", "host:port", sshConfig)
if err != nil {
return nil, fmt.Errorf("Failed to dial: %s", err)
}
session, err := connection.NewSession()
if err != nil {
return nil, fmt.Errorf("Failed to create session: %s", err)
}
err = session.Run("sudo /misc/shared_data/rdelval1/RAPL_PKG_Throttle.py 100")
}