脚本内容如下,需要配合ip.txt使用。ip.txt里写上需要检查的ip
for i in `cat ./ip.txt`
do
{
ping -c 1 $i >/dev/null 2>&1
if [ ! $? -eq 0 ]
then
echo `date +%Y%m%d%H%M` >>./error_ip.txt
echo $i >>./error_ip.txt
echo >>./error_ip.txt
fi
}&
done
wait
转载于:https://blog.51cto.com/zhukeqiang/1787392