0

テストを実行したいクラウド インスタンスがあります。OS は Centos 6.3 です。

tcpdump/vmstat/top などのモニターを使用しているときに jar ファイルを実行するにはどうすればよいですか?

4

1 に答える 1

2

バックグラウンドで実行します。これは、他のプロセスの実行中に使用した tcpdump の停止と開始です。

function tcpdumpStart()
{
     echo "Turning on tcpdump to snoop the tunnel"
     sudo /usr/sbin/tcpdump -i tun0 -s0 -w /tmp/decoderTunnel.pcap &
     echo "tcpdump started" 
}

function tcpdumpStop()
{
     echo "Killing tunnel snoop"
     sudo pkill tcpdump
     sudo chmod =rwx,g+s /tmp/decoderTunnel.pcap 
     echo "Moving tunnel pcap decoderTunnel.pcap to ${testResultDest}"
     sudo mv /tmp/decoderTunnel.pcap ${testResultDest}
}

起動したいプロセスごとに同様のことを行います

于 2013-09-03T08:13:47.463 に答える