mirror of https://gitee.com/openkylin/genmai.git
commit
a936176553
3
logfile
3
logfile
|
@ -1 +1,4 @@
|
|||
2022/11/16 17:01:43 检测为liunx系统
|
||||
2022/11/16 17:41:37 检测为liunx系统
|
||||
2022/11/16 17:41:37 frameWork sure
|
||||
2022/11/16 17:41:37 ssh connect succ
|
||||
|
|
|
@ -7,7 +7,9 @@ import(
|
|||
"main/src/genmai/RemoteCheck"
|
||||
"strings"
|
||||
"strconv"
|
||||
// "log"
|
||||
)
|
||||
|
||||
var RequestsWeb string
|
||||
var RequestsSystem string
|
||||
var RequestsKernel string
|
||||
|
@ -15,6 +17,7 @@ var RequestsBaseLine string
|
|||
var Num int
|
||||
var RequestsIP string
|
||||
var PoolStatNums int
|
||||
|
||||
func ParameterParser(sSystem string,sKernel string,sWeb string,sBaseLine string,sAll string,PoolStatNum int,ParserNum int,Update string ,IP string){
|
||||
|
||||
if sSystem!="false"{
|
||||
|
@ -137,6 +140,7 @@ func ParameterParser(sSystem string,sKernel string,sWeb string,sBaseLine string,
|
|||
Pool.CoprogramPool(Num,RequestsSystem,RequestsKernel,RequestsWeb,RequestsBaseLine,PoolStatNums,RequestsIP)
|
||||
}
|
||||
|
||||
//远程参数解析
|
||||
func RemoteArgParser(SSHHost string,SSHUser string,SSHPassword string)(checkResult string){
|
||||
if SSHHost !="false" && SSHUser !="false" &&SSHPassword !="false"{
|
||||
|
||||
|
@ -144,7 +148,8 @@ func RemoteArgParser(SSHHost string,SSHUser string,SSHPassword string)(checkResu
|
|||
if SSHHostCheck !="true"{
|
||||
fmt.Println("host错误")
|
||||
}else{
|
||||
command:="id"
|
||||
//解析远程连接的架构
|
||||
command:="whoami"
|
||||
result:=RemoteCheck.SSHConnect(SSHHost,SSHUser,SSHPassword,command)
|
||||
checkResult=strconv.FormatBool(strings.Contains(result, "root"))
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
package RemoteCheck
|
||||
|
||||
import(
|
||||
"log"
|
||||
)
|
||||
|
||||
func SCPFile(){
|
||||
|
||||
log.Println("SCP File success")
|
||||
|
||||
}
|
|
@ -81,8 +81,7 @@ func SSHConnect(SSHHost string,SSHUser string, SSHPassword string,command string
|
|||
|
||||
|
||||
}
|
||||
|
||||
log.Println("命令输出:",string(combo))
|
||||
log.Println("ssh connect succ")
|
||||
defer session.Close()
|
||||
result=string(combo)
|
||||
return result
|
||||
|
|
Loading…
Reference in New Issue