




















如题
#! /bin/bash function netstat() { file="$1" Key="$2" res=`cat $file` title=`echo "$res" |grep $Key |head -n 1` value=`echo "$res" |grep $Key |tail -n 1` num=`echo $title |awk '{print NF}'` for ((i=2; i<$num+1; i++)) do t=`echo "$title" |cut -d' ' -f "$i"` v=`echo "$value" |cut -d' ' -f "$i"` echo "tong_netstat_title:$t; tong_netstat_value=$v" done } netstat "/proc/net/netstat" "TcpExt:" netstat "/proc/net/netstat" "IpExt:" netstat "/proc/net/netstat" "IpExt:" netstat "/proc/net/snmp" "Ip:" netstat "/proc/net/snmp" "Icmp:" netstat "/proc/net/snmp" "IcmpMsg:" netstat "/proc/net/snmp" "Tcp:" netstat "/proc/net/snmp" "Udp:" netstat "/proc/net/snmp" "UdpLite:"
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。