LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Script to Ping Linux servers (https://www.linuxquestions.org/questions/linux-server-73/script-to-ping-linux-servers-4175577710/)

linux0606 04-18-2016 05:10 AM

Script to Ping Linux servers
 
I have a list of ip addresses. I can use fping to read all the ip addresses from the file and check the ping status.

Now I want to loop around all the ip addresses changing the host in a round robin fashion. Needed help to loop through.

Ex: file has ip address list from 192.168.0.1 to 192.168.0.255

round 1: will run the script to ping from host 192.168.1.1 and check 192.168.0.2 to 192.168.0.255

round 2: Now I have to run the same script from host 192.168.0.2 and check 192.168.0.3 to 192.168.0.255 (skip 192.168.1.1 as already tested).

thanks in advance

wpeckham 04-18-2016 05:15 AM

Need More Data.
 
That sounds interesting.

So, is there a problem or question related to that you wanted to ask about?

linux0606 04-18-2016 05:35 AM

Need script to loop through the entire file and display list of server combinations not pinging

TenTenths 04-18-2016 06:09 AM

What have you written so far?

michaelk 04-18-2016 06:52 AM

Not sure of your exact needs but read the man page for fping. It can read a file with a list of IPs as well as output just those unreachable.

TB0ne 04-18-2016 08:09 AM

Quote:

Originally Posted by linux0606 (Post 5532771)
Need script to loop through the entire file and display list of server combinations not pinging

You also need to read the LQ Rules and "Question Guidelines". We will be happy to HELP, but we WILL NOT write your scripts/do your homework for you.

Also...this has been asked (and answered), many, MANY times on this site, and Google also has thousands of hits for this. With sample scripts....did you try to do ANY research on your own??


All times are GMT -5. The time now is 11:40 AM.