#!/bin/bash # Simple SHELL script for Linux and UNIX system monitoring with # ping command # code by robert for ((a=1;a<=255;a++));do HOSTS="192.168.132.$a" COUNT=1 for myhost in $HOSTS do count=$(ping -c $COUNT $myhost | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }') if [ $count -eq 0 ]; then # 100% failue echo "$myhost is down (ping failed)" else echo "$myhost is up" fi done done 摘自 Robert's Blog
查看更多关于Linux shell 检测内网中存活主机 - 网站安全 - 自学的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did12134