LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 07-25-2006, 04:28 AM   #1
ohalnet
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Rep: Reputation: 0
Simple question about command syntax ping/log ping results


Hi all

I am new to linux and need help on a two simple issues. I'll really appreciate if you can help me.

Issue 1. On the command line window of red hat 8.0, I want to ping an IP address continuosly and log the ping results as text file. If it is possible, I want to execute both commands(ping and log) in the same line. What would be the correct command syntax? (I mean I need to execute both ping and log with one "ENTER")

PS: I have to see the ping reply packets on the screen while it is being logged at the same time.

Issue 2. I need to ping 20 IP addresses on 20 command line windows at the same time, log the ping results as well. In other words I need to do Issue one on 20 windows and 20 IP addresses. Could you help me how to create a script about do Issue 2 with one command?

command line window 1: pings and logs 192.168.1.1,
command line window 2: pings and logs 192.168.1.2,
...
...
command line window 10: pings and logs 192.168.1.10

Thank in advance for helping
 
Old 07-25-2006, 04:46 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
Something like this would be a start:
#!/bin/sh
ping $1 | tee /log/ping_$1


Use it like this:
script <ip>

There's also several tools that do it. oping for example.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 13 03-17-2011 02:47 AM
PPP establish can ping the gateway router but unable to ping the host deepalalla Linux - Networking 0 11-18-2004 09:10 AM
windows 98 m/c ping to ip address of red hat server but fails to ping hostname ravilohot Linux - Networking 2 09-07-2004 04:57 AM
no ping results (no net) on old laptop CodeCrush Linux - Networking 7 08-09-2004 06:05 AM
ways to log command 'ping' 'telnet' noelcantona Programming 3 09-28-2003 07:10 AM


All times are GMT -5. The time now is 01:06 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration