Wednesday, July 21, 2010

Identify a set of unresponsive servers!!

Crisis! Outage!! My online server repository is also down. Need to figure out quickly which and all server is Alive. Luckily I have a list of servers, and I know the subnet of quite a few of them. This is how would I go about -

for i in `cat wslist.txt`; do nc -v -w 1 -z $i 22 ; done
for i in `cat wslist.txt`; do nmap -sP -n $i ; done | grep down

With the help of Broadcast address,
# ifconfig | grep Bcast
inet addr: Bcast: Mask:
and then,
# ping -b

Note: Please remember, some/most of the routers are configured to filter broadcast and multicast packets to prevent broadcast storm, if so, broadcast is useless.

for ((i=1;i<255;i++)); href="">fping and netdiscover is also used by some gurus.
Do share, your way of quickest discovery of unresponsive hosts.


No comments:

Post a Comment

Why Database CI/CD?

Making the Database Part of Your Continuous Delivery Pipeline The database, unlike other software components and code or compiled co...