Networking Forums

Networking Forums > Computer Networking > Linux Networking > Ping command + Time

Reply
Thread Tools Display Modes

Ping command + Time

 
 
Tokinux
Guest
Posts: n/a

 
      09-12-2006, 07:44 PM
Hi All!

I need to ping an host with time and date in the reply.

It's possible in some way?

An option or a tool maybe......

Pls help me!

Regards,
Paolo


 
Reply With Quote
 
 
 
 
Rick Jones
Guest
Posts: n/a

 
      09-12-2006, 08:02 PM
Tokinux <(E-Mail Removed)> wrote:
> I need to ping an host with time and date in the reply.


I presume you mean the host's time and date, rather than the system
from which you send the "ping?"

> It's possible in some way?


*) install inetd/xinetd and enable the daytime service.

$ telnet somehost daytime
Trying...
Connected to somehost.
Escape character is '^]'.
Tue Sep 12 12:55:55 PDT 2006
Connection closed by foreign host.

*) install xntpd on the host and send it an NTP query.

Those are "pings" only in the general sense of the term. They are
specifically _not_ ICMP Echo Requests and Replies.

rick jones
--
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
 
Reply With Quote
 
Tokinux
Guest
Posts: n/a

 
      09-12-2006, 09:07 PM

> I presume you mean the host's time and date, rather than the system
> from which you send the "ping?"


Uhmmmm not exactly......
I will need a similar thing:

09/12/2006 23.06 Reply to 192.168.0.1: byte=32 durata=6ms TTL=64
09/12/2006 23.06 Reply to 192.168.0.1: byte=32 durata=100ms TTL=64
09/12/2006 23.07 Reply to 192.168.0.1: byte=32 durata=100ms TTL=64

Etc....

It's possible?

Thank you for your reply.

Regards,

Paolo


 
Reply With Quote
 
Rick Jones
Guest
Posts: n/a

 
      09-12-2006, 10:28 PM
Tokinux <(E-Mail Removed)> wrote:
>> I presume you mean the host's time and date, rather than the system
>> from which you send the "ping?"


> Uhmmmm not exactly......
> I will need a similar thing:


> 09/12/2006 23.06 Reply to 192.168.0.1: byte=32 durata=6ms TTL=64
> 09/12/2006 23.06 Reply to 192.168.0.1: byte=32 durata=100ms TTL=64
> 09/12/2006 23.07 Reply to 192.168.0.1: byte=32 durata=100ms TTL=64


Is that time the time being reported on the system running ping? If
so, then the most straightforward thing to do would be for you to find
some suitable ping source code and add the gettimeofday() call where
it prints the results of the ICMP Echo Reply being received.

rick jones
--
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
 
Reply With Quote
 
Floyd L. Davidson
Guest
Posts: n/a

 
      09-12-2006, 11:17 PM
"Tokinux" <(E-Mail Removed)> wrote:
>> I presume you mean the host's time and date, rather than the system
>> from which you send the "ping?"

>
>Uhmmmm not exactly......
>I will need a similar thing:
>
>09/12/2006 23.06 Reply to 192.168.0.1: byte=32 durata=6ms TTL=64
>09/12/2006 23.06 Reply to 192.168.0.1: byte=32 durata=100ms TTL=64
>09/12/2006 23.07 Reply to 192.168.0.1: byte=32 durata=100ms TTL=64
>
>Etc....
>
>It's possible?
>
>Thank you for your reply.
>
>Regards,
>
>Paolo


Here is something that will be very close. I'm not sure what
the exactly output from your particular ping program is, so I
can't make this match yours as opposed to mine. The script
output I get looks like this:

09/12/2006 15.04 192.168.1.103: icmp_seq=1 ttl=64 time=1.45 ms

However, the output from my ping, looks like this,

PING 192.168.1.103 (192.168.1.103) 56(84) bytes of data.
64 bytes from 192.168.1.103: icmp_seq=1 ttl=64 time=1.63 ms

And the script *depends* upon the first line *not* starting with
the same word as the other lines, and the lines of interest all
start with "64" and have exactly three words in front of the
data that is to be printed.

If you are not into shell programming, just post a few lines of
your ping output, and I'll be able to change the script to match.

#!/bin/bash

if [ -z "$1" ] ; then exit 1; fi

ping $1 | while read arg1 arg2 arg3 arg4 ; do

#
# The first line is a prefered format, the second line
# formats as requested.
#
date=$(/bin/date "+%m/%d/%Y %H.%M")
# date=$(/bin/date "+%Y-%m-%d %H.%M")

case $arg1 in
64*) echo -n "${date} $arg4" ;;
esac
done

--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) (E-Mail Removed)
 
Reply With Quote
 
Tokinux
Guest
Posts: n/a

 
      09-13-2006, 05:17 PM
Thank you very much! It works!!
But........how can I divide the output row per row?

Thanks again!
Paolo

"Floyd L. Davidson" <(E-Mail Removed)> ha scritto nel messaggio
news:(E-Mail Removed)...
> "Tokinux" <(E-Mail Removed)> wrote:
>>> I presume you mean the host's time and date, rather than the system
>>> from which you send the "ping?"

>>
>>Uhmmmm not exactly......
>>I will need a similar thing:
>>
>>09/12/2006 23.06 Reply to 192.168.0.1: byte=32 durata=6ms TTL=64
>>09/12/2006 23.06 Reply to 192.168.0.1: byte=32 durata=100ms TTL=64
>>09/12/2006 23.07 Reply to 192.168.0.1: byte=32 durata=100ms TTL=64
>>
>>Etc....
>>
>>It's possible?
>>
>>Thank you for your reply.
>>
>>Regards,
>>
>>Paolo

>
> Here is something that will be very close. I'm not sure what
> the exactly output from your particular ping program is, so I
> can't make this match yours as opposed to mine. The script
> output I get looks like this:
>
> 09/12/2006 15.04 192.168.1.103: icmp_seq=1 ttl=64 time=1.45 ms
>
> However, the output from my ping, looks like this,
>
> PING 192.168.1.103 (192.168.1.103) 56(84) bytes of data.
> 64 bytes from 192.168.1.103: icmp_seq=1 ttl=64 time=1.63 ms
>
> And the script *depends* upon the first line *not* starting with
> the same word as the other lines, and the lines of interest all
> start with "64" and have exactly three words in front of the
> data that is to be printed.
>
> If you are not into shell programming, just post a few lines of
> your ping output, and I'll be able to change the script to match.
>
> #!/bin/bash
>
> if [ -z "$1" ] ; then exit 1; fi
>
> ping $1 | while read arg1 arg2 arg3 arg4 ; do
>
> #
> # The first line is a prefered format, the second line
> # formats as requested.
> #
> date=$(/bin/date "+%m/%d/%Y %H.%M")
> # date=$(/bin/date "+%Y-%m-%d %H.%M")
>
> case $arg1 in
> 64*) echo -n "${date} $arg4" ;;
> esac
> done
>
> --
> Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
> Ukpeagvik (Barrow, Alaska) (E-Mail Removed)



 
Reply With Quote
 
Tokinux
Guest
Posts: n/a

 
      09-13-2006, 05:36 PM
Ok, I do it!!
Tnx again!!

Regards,

Paolo

"Tokinux" <(E-Mail Removed)> ha scritto nel messaggio
news:73XNg.20555$(E-Mail Removed).. .
> Thank you very much! It works!!
> But........how can I divide the output row per row?
>
> Thanks again!
> Paolo
>
> "Floyd L. Davidson" <(E-Mail Removed)> ha scritto nel messaggio
> news:(E-Mail Removed)...
>> "Tokinux" <(E-Mail Removed)> wrote:
>>>> I presume you mean the host's time and date, rather than the system
>>>> from which you send the "ping?"
>>>
>>>Uhmmmm not exactly......
>>>I will need a similar thing:
>>>
>>>09/12/2006 23.06 Reply to 192.168.0.1: byte=32 durata=6ms TTL=64
>>>09/12/2006 23.06 Reply to 192.168.0.1: byte=32 durata=100ms TTL=64
>>>09/12/2006 23.07 Reply to 192.168.0.1: byte=32 durata=100ms TTL=64
>>>
>>>Etc....
>>>
>>>It's possible?
>>>
>>>Thank you for your reply.
>>>
>>>Regards,
>>>
>>>Paolo

>>
>> Here is something that will be very close. I'm not sure what
>> the exactly output from your particular ping program is, so I
>> can't make this match yours as opposed to mine. The script
>> output I get looks like this:
>>
>> 09/12/2006 15.04 192.168.1.103: icmp_seq=1 ttl=64 time=1.45 ms
>>
>> However, the output from my ping, looks like this,
>>
>> PING 192.168.1.103 (192.168.1.103) 56(84) bytes of data.
>> 64 bytes from 192.168.1.103: icmp_seq=1 ttl=64 time=1.63 ms
>>
>> And the script *depends* upon the first line *not* starting with
>> the same word as the other lines, and the lines of interest all
>> start with "64" and have exactly three words in front of the
>> data that is to be printed.
>>
>> If you are not into shell programming, just post a few lines of
>> your ping output, and I'll be able to change the script to match.
>>
>> #!/bin/bash
>>
>> if [ -z "$1" ] ; then exit 1; fi
>>
>> ping $1 | while read arg1 arg2 arg3 arg4 ; do
>>
>> #
>> # The first line is a prefered format, the second line
>> # formats as requested.
>> #
>> date=$(/bin/date "+%m/%d/%Y %H.%M")
>> # date=$(/bin/date "+%Y-%m-%d %H.%M")
>>
>> case $arg1 in
>> 64*) echo -n "${date} $arg4" ;;
>> esac
>> done
>>
>> --
>> Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
>> Ukpeagvik (Barrow, Alaska) (E-Mail Removed)

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how ping command resolve name? tree leafs Windows Networking 4 05-18-2007 03:42 AM
Extended Ping command tool Saeed Pazoki Windows Networking 3 05-01-2006 12:23 PM
Wireless router's ping time DI-624 got worse over time PT Wang Wireless Internet 0 12-31-2003 04:35 PM
Windows ping and Linux ping command? tom Linux Networking 5 11-10-2003 08:52 PM
Ping Command William Windows Networking 1 08-26-2003 07:04 PM



1 2 3 4 5 6 7 8 9 10 11