From c115a149ff971a91df3a559810855fc569aebd22 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 26 Apr 2024 18:22:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20UPF=E6=8A=93=E5=8C=85=E8=84=9A=E6=9C=ACt?= =?UTF-8?q?elnet=E5=9C=B0=E5=9D=80localhost=E6=94=B9neIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/trace/service/tcpdump.impl.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/trace/service/tcpdump.impl.go b/src/modules/trace/service/tcpdump.impl.go index 938fd742..5fb1c2ea 100644 --- a/src/modules/trace/service/tcpdump.impl.go +++ b/src/modules/trace/service/tcpdump.impl.go @@ -143,7 +143,8 @@ func (s *TcpdumpImpl) DumpUPF(neType, neId, cmdStr string) (string, string, erro timeStr := date.ParseDateToStr(time.Now(), date.YYYYMMDDHHMMSS) fileName := fmt.Sprintf("%s_%s", timeStr, neTypeID) // UPF标准版本telnet脚本 - scriptStr := "set pcapCmd [lindex $argv 0]\nspawn telnet localhost 5002\nexpect \"upfd1# \"\nsend \"$pcapCmd\\n\"\nexpect \"upfd1# \"\nsend \"quit\\n\"\nexpect \"eof\"" + scriptStr := "set pcapCmd [lindex $argv 0]\nspawn telnet " + neInfo.IP + " 5002\nexpect \"upfd1# \"\nsend \"$pcapCmd\\n\"\nexpect \"upfd1# \"\nsend \"quit\\n\"\nexpect \"eof\"" + // scriptStr := "set pcapCmd [lindex $argv 0]\nspawn telnet localhost 5002\nexpect \"upfd1# \"\nsend \"$pcapCmd\\n\"\nexpect \"upfd1# \"\nsend \"quit\\n\"\nexpect \"eof\"" writePcapFile := fmt.Sprintf("echo '%s' > pcapUPF.sh\n %s chmod +x pcapUPF.sh", scriptStr, withSudo) writeLogFile := fmt.Sprintf("> %s.log 2>&1 \ncat %s.log", fileName, fileName)