Re: bash script: alive host?
Please give an example of what kind of input you want to provide and what kind of output you expect.
Re: bash script: alive host?
Quote:
Originally Posted by
conradin
Hi everyone,
Im looking for a function, or program I can call via a script that will allow me to get the hostname, and IP of only alive hosts. When by alive, I mean hosts that are on the network and responding to ping type requests. When I poll the Domain name server, I get names and addresses which may not be currently active.
Does anyone have a good idea for this?
In theory this should be enough:
- "ifconfig <interface>" e.g. "ifconfig eth0" of "ifconfig wlan0"
- Retrieve the broadcast address (Bcast:")
- "ping -b {broadcast_address} and check who answers
In practice due to firewalls plenty of hosts won't answer.
Re: bash script: alive host?
Thanks Lars,
nmap actualy works quiet well for what Im trying to do, I'll use that.