linuxShell检测内网中存活主机,windows下net view/nmblookup
2021-07-12 00:06
标签:ber com fail imp tor bin moni style ++ 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#!/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
文章标题:linuxShell检测内网中存活主机,windows下net view/nmblookup
文章链接:http://soscw.com/index.php/essay/103906.html