#!/bin/sh
#filename:Check-host_online.sh
#date:2015-12-23
#作者:linuxzkq
#Email:1729294227@qq.com
#version:v1.0
for n in `seq 254`
do
ping -c1 10.0.0.$n >/dev/null 2>&1
if [ $? -eq 0 ]
then
echo "10.0.0.$n is up" >>/data/uplist.log
else
echo "10.0.0.$n is down" >>/data/downlist.log
fi
done
本文出自 “兰州linux运维” 博客,请务必保留此出处http://linuxzkq.blog.51cto.com/9379412/1728872
原文:http://linuxzkq.blog.51cto.com/9379412/1728872