LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Pinging All the Nodes Connected to the Server (http://www.linuxquestions.org/questions/linux-newbie-8/pinging-all-the-nodes-connected-to-the-server-726200/)

Hi_This_is_Dev 05-15-2009 09:13 AM

Pinging All the Nodes Connected to the Server
 
Hi All,


I want to write a ShellScript file which runs on the Server and does the followings:

1) Get info, IP or Machine Name mainly, of all the nodes connected to the server.

2) Ping each of them one by one.


So, the main problem which I am having is how to get this info as to how many IPs are present there so that they can be pinged?

I have this Pseudo Code for it:
Code:

Store the IPs in a Variable or Array List

(Loop through the Array List)

For in ( Machine )

Ping -c 3 Machine's IP >> /tmp/NetWorkReport.txt

Done


Any creative ideas?

mac178 05-15-2009 10:43 AM

I am not a big expert, but did you had a look at nmap?
I think the nmap -sP <ip address rang> do just what you need.


All times are GMT -5. The time now is 08:00 PM.