#!/bin/bash ip=你要ping的值 echo "你ping的地址为:${ip}" num=`ping -c 1 ${ip} |grep icmp_seq|awk '{print $8}'|cut -d= -f2` # echo $num time=$(date +%Y%m%d-%H:%M:%S) for detection in $num do if [ `echo "${detection}>14"|bc` -eq 1 ]; then echo "延时大于14s,现在为${detection},时间${time}"; # echo "现在为${detection},时间${time}"; fi done

Shell ping延迟大于14秒,输出来

文章版权及转载声明
作者:吴先生本文地址:https://www.ahaoyw.com/article/266.html发布于 8个月前 ( 05-10 )
文章转载或复制请以超链接形式并注明出处阿豪运维 | AhaoYw.Com