linuxShell检测内网中存活主机,windows下net view/nmblookup

2021-07-12 00:06

阅读:497

标签:ber   com   fail   imp   tor   bin   moni   style   ++   

 

 

#!/bin/bash
    # Simple SHELL script for Linux and UNIX system monitoring with
    # ping command
    # code by robert
    for ((a=1;a255;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

linuxShell检测内网中存活主机,windows下net view/nmblookup

标签:ber   com   fail   imp   tor   bin   moni   style   ++   

原文地址:https://www.cnblogs.com/timxgb/p/9629677.html


评论


亲,登录后才可以留言!