#!/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="10.67.12.$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
windows下net view显示局域网所有正在运行的电脑
nmblookup
dig