欧卡2中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

需要三步,才能开始

只需两步,慢速开始

查看: 5595|回复: 0
收起左侧

test

[复制链接]
oppo 发表于 2016-2-24 12:55 | 显示全部楼层 |阅读模式
[tex=md]#轮询测试
## 功能
发送指定数量的dns查询包,并统计第一行返回值
## 使用方法
使用方法 ./polling.sh n domain   n代表总次数,domain为需要测试的域名  
注:根据实际测试环境,需对脚本中的内容进行微调   
## 脚本

```
[root@EnlinkDNS ~]# cat polling.sh
#! /bin/bash
TMP_FILE="mktemp /tmp/polling.XXXXXXXX"
polling=`TMPFILEidx=0while[idx -lt 1]dodigtA2 @192.168.5.140  +noall +answer | awk 'NR==4{print}' |awk '{print 5}' >>polling
idx=(expridx + 1)
done
echo total: 1sortpolling | uniq -c | awk '{print 2"appeartimes:"1}'
rm -f $polling

````
##运行结果

```
[root@EnlinkDNS ~]# ./polling.sh 100 www.eee.com
total: 100
1.1.1.1 appear times: 30
2.2.2.2 appear times: 38
3.3.3.3 appear times: 32

```
[/tex]
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

客服QQ936487697|联系我们|手机版|欧卡2中国 ( 湘ICP备11020288号-1 )

GMT+8, 2025-5-18 06:55 , Processed in 0.047982 second(s), 9 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表