检查arp表是否满

#!/bin/bash

LANG=C
test -e /bin/date && timestamp=`/bin/date +%s`
ARP=`which arp`
arp_num=$(wc -l /proc/net/arp|awk '{print $1}')

check_full=0
time0=$(dmesg |tail -n 1000|grep 'Neighbour table overflow'|tail -n1 |awk '{print $1}'|sed -r 's/[^0-9\.]//g')
time1=$(cat /proc/uptime |awk '{print $1}')
check_full=$(echo "$time1 $time0"|awk '{if(($1-$2)/3600<24){print 1 }else{print 0 }}')
if [ -z $time0 ];then
    check_full=0
fi
if [ $check_full -eq 1 ];then
    MSG="arp_cache_full"
else
    MSG="arp_cache_not_full"
fi
#If check_full=0 means arp_cache_not_full
#check_full
echo -e "$timestamp\tarp_cache_count=$arp_num check_full=$check_full msg=$MSG"

check_arp的更多相关文章

  1. lvs+keepalived

    一.简介 VS/NAT原理图: 二.系统环境 实验拓扑: 系统平台:CentOS 6.3 Kernel:2.6.32-279.el6.i686 LVS版本:ipvsadm-1.26 keepalive ...

随机推荐

  1. ubuntu配置openvpn

    http://www.zhixing123.cn/ubuntu/ubuntu-openvpn-settings-tutorial.html 本文介绍Ubuntu连接使用OpenVPN方法教程,Ubun ...

  2. 转:Visual Studio进行Web性能测试- Part I

    原文作者:Ambily.raj Visual Studio是可以用于性能测试的工具之一.Visual Studio Test版或Visual Studio 2010旗舰版为自动化测试提供了支持.本文介 ...

  3. PAT (Advanced Level) 1059. Prime Factors (25)

    素因子分解. #include<iostream> #include<cstring> #include<cmath> #include<algorithm& ...

  4. gitlab应用

    1.git config --global user.email "my@bimt.com" //注册本地环境 2.ssh-keygen -t rsa -C "my@bi ...

  5. HDU 3265 Posters

    矩形面积并,一个拆成四个 #include<cstdio> #include<cstring> #include<cmath> #include<map> ...

  6. docker-compose 所带来的方便

    docker-compose 是一款开源的docker 简化复杂容器环境的管理工具 . docker-compose 在结合Swarm 与 docker 进程化容器部署可以很方便的部署一套环境. 具体 ...

  7. [转] spring事务管理几种方式

    前段时间对Spring的事务配置做了比较深入的研究,在此之间对Spring的事务配置虽说也配置过,但是一直没有一个清楚的认识.通过这次的学习发觉Spring的事务配置只要把思路理清,还是比较好掌握的. ...

  8. Quick Cocos2dx Http通讯 JSON

    参考: 1 http://stackoverflow.com/questions/5975952/how-to-extract-http-message-body-in-basehttprequest ...

  9. 关于iOS后台模式

    https://onevcat.com/2013/08/ios7-background-multitask/ http://zhidao.baidu.com/link?url=NUOMrLGB6Odr ...

  10. POJ 3458 Colour Sequence

    水题. #include<cstdio> #include<cstring> #include<cmath> + ; char s[maxn], v[maxn], ...