(14)批量ping
#!/bin/bash
fail=0
for ips in `cat test`
do
result=`ping -w 2 -c 3 ${ips} | grep packet | awk -F" " '{print $6}'| awk -F"%" '{print $1}'| awk -F' ' '{print $1}'`
sleep 5
if [[ $result -ne 0 ]];then
let fail++
echo " ${ips} is fail ! "
else
echo " ${ips} is ok ! "
fi
done
echo " fail node counter= $fail "
作者:admin 创建时间:2023-04-27 13:45
最后编辑:admin 更新时间:2024-07-17 15:26
最后编辑:admin 更新时间:2024-07-17 15:26