feat: 新增ping 网元端版本信息检查接口

This commit is contained in:
TsMask
2024-10-16 17:23:15 +08:00
parent 548090bfbe
commit 4897299ba3
4 changed files with 41 additions and 11 deletions

View File

@@ -23,15 +23,8 @@ type IPerf struct{}
// Version 查询版本信息
func (s *IPerf) Version(meType, neId string) (string, error) {
// 网元主机的SSH客户端
sshClient, err := neService.NewNeInfo.NeRunSSHClient(meType, neId)
if err != nil {
return "", err
}
defer sshClient.Close()
// 检查是否安装iperf3
output, err := sshClient.RunCMD("iperf3 --version")
output, err := neService.NewNeInfo.NeRunSSHCmd(meType, neId, "iperf3 --version")
if err != nil {
return "", fmt.Errorf("iperf3 not installed")
}