yyyyyyyyyyyyyyyyyyyy

博客园 首页 新随笔 联系 订阅 管理

 

 

#!/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

posted on 2018-09-11 19:04  xxxxxxxx1x2xxxxxxx  阅读(518)  评论(0编辑  收藏  举报