Linux Shell 网络层监控脚本(监控包括:连接数、句柄数及根据监控反馈结果分析)

时间:2014-05-24 03:05:11   收藏:0   阅读:420

脚本监控:

bubuko.com,布布扣

获取最大句柄数的进程:

bubuko.com,布布扣

链接分析:

bubuko.com,布布扣

脚本片段:

bubuko.com,布布扣
 case "$handle" in
          2)
            echo "The handle of the process :   "
            echo " " 
            handle | awk {print $3 "\n" $5 "\n" $7 "\n" $9 "\n" $11 "\n"} > temp      
            for i in `cat temp`
            do 
               ps -ef | grep $i | awk {print "{" $2 "}" ":" "{" $8 "}" ":" "{" $15 "}"} | grep $i             
            done
            rm -rf temp
            echo "等待5秒后,自动调整上一页。退出请按ctrl+c:"       
            sleep 5
            ;;
           1)
            echo "analysis"
            echo " "                   
            if [ $closewait -ge "20" ]
            then
                echo "CLOSE_WAIT:$closewait" 
                echo "长时间存在大量的CLOSE_WAIT没有被释放,会导致系统响应能力变慢,建议修改Linux内核参数http://cnblogs.com/javame"
            fi
bubuko.com,布布扣

脚本下载:

http://download.csdn.net/detail/yiyu1/7369159

 

Linux Shell 网络层监控脚本(监控包括:连接数、句柄数及根据监控反馈结果分析),布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!