Copy Code code as follows:
#!/bin/sh
Clear
while ((1>0))
Todo
net=$ (NETSTAT-ANP | grep 1000 | grep EST | wc-l)
prc=$ (ps aux | grep thread1 | grep-v grep | grep-v Screen | awk ' {print ' CPU: "$"%, MEM: "$"%, RSS: "$6/1024" M, VSZ: "$5/1024" M, PID: "$" "}"
Tput SC; Echo-n-E "\b"; Tput RC;
echo "Srv:thread1, NET: $NET, $PRC"
echo ""
net=$ (NETSTAT-ANP | grep 1011 | grep EST | wc-l)
prc=$ (ps aux | grep thread2 | grep-v grep | grep-v Screen | awk ' {print ' CPU: "$"%, MEM: "$"%, RSS: "$6/1024" M , VSZ: "$5/1024" M, PID: "$" "}")
Tput SC; Echo-n-E "\b"; Tput RC;
echo "Srv:thread2, NET: $NET, $PRC"
echo ""
net=$ (NETSTAT-ANP | grep 1022 | grep EST | wc-l)
prc=$ (ps aux | grep thread3 | grep-v grep | grep-v Screen | awk ' {print ' CPU: "$"%, MEM: "$"%, RSS: "$6/1024" M , VSZ: "$5/1024" M, PID: "$" "}")
Tput SC; Echo-n-E "\b"; Tput RC;
echo "Srv:thread3, NET: $NET, $PRC"
echo ""
net=$ (NETSTAT-ANP | grep 1033 | grep EST | wc-l)
prc=$ (ps aux | grep thread4 | grep-v grep | grep-v Screen | awk ' {print ' CPU: "$"%, MEM: "$"%, RSS: "$6/1024" M , VSZ: "$5/1024" M, PID: "$" "}")
Tput SC; Echo-n-E "\b"; Tput RC;
echo "Srv:thread4, NET: $NET, $PRC"
echo ""
net=$ (NETSTAT-ANP | grep beam.smp | grep EST | grep 222.222.18.222:800 | wc-l)
prc=$ (ps aux | grep thread | grep-v grep | awk ' {CPU + = $} {MEM + $} {RSS = $} {VSZ = $} end {print CPU: "CPU" %, mem: "mem"%, RSS: "rss/1024" M, VSZ: "vsz/1024" M, "" ""} ' | awk ' End {print} ')
Tput SC; Echo-n-E "\b"; Tput RC;
echo "Srv:all, NET: $NET, $PRC"
echo ""
Sleep 0.5
Tput Cup 0 0
Done