Re: script or other suggestion
- From: "Herta Van den Eynde" <herta.vandeneynde@xxxxxxxxx>
- Date: Fri, 23 Nov 2007 15:47:16 +0100
On 23/11/2007, Broekman, Maarten <Maarten.Broekman@xxxxxxx> wrote:
Why not just do DNS lookups to see which ones are assigned?
To build on what Cameron mentioned, just put in "host $i" in the loop
and check to see it returns anything sane. If so, you might want to
ping it to see if it's up, but as Cameron said, the system could be down
or off so that's not 100% reliable.
Maarten Broekman
Email: maarten.broekman@xxxxxxx
-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx
[mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Cameron Simpson
Sent: Thursday, November 22, 2007 4:10 PM
To: General Red Hat Linux discussion list
Subject: Re: script or other suggestion
On 22Nov2007 15:35, chloe K <chloekcy2000@xxxxxxxx> wrote:
| I have ip list in my network
| I need to check which ip is unused
| what is better solution?
|
| Write the ping script or use other command
|
| eg:
|
| for i in ip.txt
| ping -c 3 $i
That would be:
for i in `cat ip.txt`
do ping -c 3 $i || { echo "IP $i is not in use."; break; }
done
Of course, if a machine happens to be down/off, if will look
like its IP is not in use...
You could possibly do something clever with nmap or "ping -b",
but your approach is simple and effective.
--
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/
To make matters worse, a system may be up but firewalls may block pings.
Kind regards,
Herta
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
- References:
- Re: script or other suggestion
- From: Cameron Simpson
- RE: script or other suggestion
- From: Broekman, Maarten
- Re: script or other suggestion
- Prev by Date: Re: script or other suggestion
- Next by Date: RE: script or other suggestion
- Previous by thread: RE: script or other suggestion
- Next by thread: RE: script or other suggestion
- Index(es):
Relevant Pages
- RE: script or other suggestion
... To build on what Cameron mentioned, just put in "host $i" in the loop ... ping
it to see if it's up, but as Cameron said, the system could be down ... must be exactly three
terminations: one on one end of the cable, ... Instant message from any web browser!
... (RedHat) - RE: script or other suggestion
... To build on what Cameron mentioned, just put in "host $i" in the loop ... ping
it to see if it's up, but as Cameron said, the system could be down ... Getting a SCSI chain
working is perfectly simple if you remember that ... must be exactly three terminations:
one on one end of the cable, ... (RedHat) - Re: Cameron; "superficiality, unreliability and an apparent lack of any clear convictions"
... no-one sane believes that.... ... so, assuming you're sane, you're lying
again ... cameron says ok lets go.... ... energy, education, politics, etc
1,552,396 document calls in year past ... (uk.politics.misc)