SHIDOU

119 ~/M2/image-installer-bak$ 脚本
sdcm@sdcm:~$ cat ping.sh1
#!/bin/bash
IP=(
172.16.0.200
172.16.0.201
172.16.0.202
172.16.0.203
172.16.0.204
172.16.0.205
172.16.0.210
172.16.0.211
172.16.0.212
172.16.0.213
172.16.0.214
172.16.0.215
172.16.0.216
172.16.0.217
)
echo "Start ping at : "`date +%Y-%m-%d-%H:%M:%S`
for PING in ${IP[*]} ;do
CHECK=`ping -c 1 -w 1 $PING |grep "time="|awk '{print $4}'`
if [ "$CHECK" = "" ];then
echo ${PING}"---""OFFLINE..."`date +%Y-%m-%d-%H:%M:%S`
else
echo ${PING}"---""OK---OK..."`date +%Y-%m-%d-%H:%M:%S`
fi
done
echo "Finished ping at : "`date +%Y-%m-%d-%H:%M:%S`
sdcm@sdcm:~$ ./ping.sh1
Start ping at : 2014-10-30-11:53:03
172.16.0.200---OK---OK...2014-10-30-11:53:03
172.16.0.201---OK---OK...2014-10-30-11:53:03
172.16.0.202---OK---OK...2014-10-30-11:53:03
172.16.0.203---OK---OK...2014-10-30-11:53:03
172.16.0.204---OK---OK...2014-10-30-11:53:03
172.16.0.205---OK---OK...2014-10-30-11:53:03
172.16.0.210---OK---OK...2014-10-30-11:53:03
172.16.0.211---OK---OK...2014-10-30-11:53:03
172.16.0.212---OK---OK...2014-10-30-11:53:03
172.16.0.213---OK---OK...2014-10-30-11:53:03
172.16.0.214---OK---OK...2014-10-30-11:53:03
172.16.0.215---OK---OK...2014-10-30-11:53:03
172.16.0.216---OK---OK...2014-10-30-11:53:03
172.16.0.217---OK---OK...2014-10-30-11:53:03
Finished ping at : 2014-10-30-11:53:03
sdcm@sdcm:~$ ping -c 1 -w 1 172.16.0.200
PING 172.16.0.200 (172.16.0.200) 56(84) bytes of data.
64 bytes from 172.16.0.200: icmp_req=1 ttl=64 time=0.835 ms
--- 172.16.0.200 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.835/0.835/0.835/0.000 ms
sdcm@sdcm:~$ ping -c 1 -w 1 172.16.0.200 |grep time\=
64 bytes from 172.16.0.200: icmp_req=1 ttl=64 time=0.839 ms
arp -an -i br0 |grep -v incom |grep -v 172.16.0. |awk -F "(" '{print $2}'|awk -F ")" '{print $1}'|sort
4、
Found AP:
172.16.0.200 172.16.0.201 172.16.0.202 172.16.0.203 172.16.0.204 172.16.0.205 172.16.0.206 172.16.0.207 172.16.0.210 172.16.0.211 172.16.0.212 172.16.0.213 172.16.0.214 172.16.0.215 172.16.0.216 172.16.0.217
Check AP...ping 3 times
16 AP:
172.16.0.200: time=0.943 ms
172.16.0.200: time=0.821 ms
172.16.0.200: time=0.820 ms
172.16.0.201: time=0.907 ms
172.16.0.201: time=0.815 ms
172.16.0.201: time=0.817 ms
172.16.0.202: time=0.437 ms
172.16.0.202: time=0.373 ms
172.16.0.202: time=0.367 ms
172.16.0.203: time=0.439 ms
172.16.0.203: time=0.366 ms
172.16.0.203: time=0.371 ms
172.16.0.204: time=0.449 ms
172.16.0.204: time=0.475 ms
172.16.0.204: time=0.375 ms
172.16.0.205: time=0.410 ms
172.16.0.205: time=0.297 ms
172.16.0.205: time=0.361 ms
172.16.0.206: time=0.915 ms
172.16.0.206: time=0.792 ms
172.16.0.206: time=0.732 ms
172.16.0.207: time=0.907 ms
172.16.0.207: time=0.832 ms
172.16.0.207: time=0.804 ms
172.16.0.210: time=0.928 ms
172.16.0.210: time=0.842 ms
172.16.0.210: time=0.843 ms
172.16.0.211: time=1.07 ms
172.16.0.211: time=0.974 ms
172.16.0.211: time=0.968 ms
172.16.0.212: time=1.09 ms
172.16.0.212: time=0.998 ms
172.16.0.212: time=1.00 ms
172.16.0.213: time=1.13 ms
172.16.0.213: time=1.00 ms
172.16.0.213: time=1.00 ms
172.16.0.214: time=0.971 ms
172.16.0.214: time=0.883 ms
172.16.0.214: time=0.847 ms
172.16.0.215: time=1.11 ms
172.16.0.215: time=0.980 ms
172.16.0.215: time=0.999 ms
172.16.0.216: time=0.977 ms
172.16.0.216: time=0.860 ms
172.16.0.216: time=0.797 ms
172.16.0.217: time=1.07 ms
172.16.0.217: time=1.06 ms
172.16.0.217: time=1.01 ms
Found client ip:
172.16.2.28 172.16.2.192 172.16.2.203 172.16.3.17 172.16.3.69 172.16.3.87
Check client ip...ping 3 times
6 client ip:
172.16.2.28: time=259 ms
172.16.2.28: time=82.7 ms
172.16.2.28: time=107 ms
ping 172.16.2.192 failed...
172.16.2.203: time=35.4 ms
172.16.2.203: time=48.9 ms
172.16.2.203: time=79.5 ms
172.16.3.17: time=56.2 ms
172.16.3.17: time=73.7 ms
172.16.3.17: time=90.9 ms
172.16.3.69: time=310 ms
172.16.3.69: time=205 ms
172.16.3.69: time=159 ms
172.16.3.87: time=93.1 ms
172.16.3.87: time=110 ms
172.16.3.87: time=31.7 ms
sdcm@sdcm:~$
SHIDOU的更多相关文章
- Bootstrap FileInput 上传 中文 API 整理
Bootstrap FileInput 上传 中文 API 整理 上传插件有很多 但是公司用的就是 Bootstrap FileInput 自己就看了看 会用就行 自己都不知道每个值是干嘛用的就问 ...
- SFC游戏列表(维基百科)
SFC游戏列表 日文名 中文译名 英文版名 发行日期 发行商 スーパーマリオワールド 超级马里奥世界 Super Mario World 1990年11月21日 任天堂 エフゼロ F-Zero F-Z ...
随机推荐
- Centos7关闭防火墙 设置开机启动
[root@nmserver-7 ~]# systemctl stop firewalld.service [root@nmserver-7 ~]# systemctl status firewall ...
- Day6 - 牛客203E
https://ac.nowcoder.com/acm/contest/203/E 埋坑不会做
- Numpy中np.random.randn与np.random.rand的区别,及np.mgrid与np.ogrid的理解
np.random.randn是基于标准正态分布产生的随机数,np.random.rand是基于均匀分布产生的随机数,其值在[0,1). np.mgrid 与np.ogrid的理解及区别:np.mgr ...
- Spring Boot2(007):关于Spring beans、依赖注入 和 @SpringBootApplication 注解
一.关于Spring beans 和 依赖注入(Dependency Injection) spring boot 和 Spring 全家桶无缝衔接,开发过程中可以很轻松地使用 Spring 全家桶的 ...
- spring boot 使用swagger
在pom.xml中添加maven依赖 <dependency> <groupId>io.springfox</groupId> <artifactId> ...
- 145-PHP 使用<<<和HTML混编(一)
<?php $html=<<<TEMP1 <title>PHP输出HTML代码</title> <body> <a href=#> ...
- 利用QRCoder生成二维码
1.项目添加QRCoder.dll 和System.Drawing.dll的引用 2.创建二维码公共处理类(QRCoderHelper.cs) /// <summary> /// 二维码公 ...
- Docker NGINX 例子
版权所有,未经许可,禁止转载 章节 Docker 介绍 Docker 和虚拟机的区别 Docker 安装 Docker Hub Docker 镜像(image) Docker 容器(container ...
- Docker 和虚拟机的区别
版权所有,未经许可,禁止转载 章节 Docker 介绍 Docker 和虚拟机的区别 Docker 安装 Docker Hub Docker 镜像(image) Docker 容器(container ...
- CF1209A Paint the Numbers
You are given a sequence of integers a1,a2,…,an. You need to paint elements in colors, so that: If w ...