LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-18-2016, 05:10 AM   #1
linux0606
LQ Newbie
 
Registered: Apr 2016
Posts: 2

Rep: Reputation: Disabled
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
 
Old 04-18-2016, 05:15 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,658

Rep: Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708
Need More Data.

That sounds interesting.

So, is there a problem or question related to that you wanted to ask about?
 
Old 04-18-2016, 05:35 AM   #3
linux0606
LQ Newbie
 
Registered: Apr 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
Need script to loop through the entire file and display list of server combinations not pinging
 
Old 04-18-2016, 06:09 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
What have you written so far?
 
Old 04-18-2016, 06:52 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,727

Rep: Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919Reputation: 5919
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.
 
1 members found this post helpful.
Old 04-18-2016, 08:09 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,652

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by linux0606 View Post
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??
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
script to do healthcheck of the Linux servers ksdeiva Programming 5 07-31-2012 02:43 PM
Getting two Linux servers to communicate (PING issues) orakris Linux - Networking 3 12-19-2010 08:04 AM
Linux can not ping windows servers 2003?? xiaohong1987 Linux - Networking 4 04-15-2010 08:57 AM
Cannot ping other servers hjazz6 Linux - Networking 2 01-12-2009 09:14 PM
Linux ping script MPowers Linux - Networking 6 07-02-2005 04:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration